Match ends, AFC Wimbledon 2, York City 1.
Jack Smith's last-gasp volley earned Wimbledon victory over York, who are left only two points above the League Two relegation zone.
The Dons went ahead when Adedeji Oshilaja headed his first senior goal from George Francomb's corner.
Jake Hyde scrambled the equaliser just before the break after Joe McDonnell failed to hold Emile Sinclair's cross.
Sinclair later squandered an easy chance and York paid the price when Smith scored from the edge of the box.
The win puts Wimbledon just six points outside the play-off places, while York are left only three places and two points above the relegation places.
AFC Wimbledon manager Neal Ardley told BBC London 94.9:
"It was a really tough game and the pitch is really causing us problems at the moment - it's the worst it's been.
"Everything, when we play at home at the moment seems to be a scrap.
"I want to entertain, I want the fans to go 'wow, we were good', like the first half at Luton. But today it was really hard to. I don't like making excuses, but the pitch doesn't allow you to play free-flowing football.
"We've got to learn to scrap, which isn't something we're normally brilliant at. Today we scrapped and scrapped and stayed in the game, then had a great moment late on."
York City manager Russ Wilcox told BBC Radio York:
"I'm gutted for the players and the supporters who have been outstanding.
"It's a very cruel game. Last minute and again everyone will talk about last minute goals this season but what do you do about that? It's down to having that little bit of luck that for me over 90 minutes hasn't gone our way.
"It was a horrible game on a horrible pitch and I thought we played well and did the basics well in general.
"I have to pick the players up and go again next week in the huge game with Carlisle."
- 35PotterSubstituted forRiggat 62'minutes
- 10AkinfenwaBooked at 72mins
- 14AzeezSubstituted forTannerat 78'minutes
- 2McCoyBooked at 76mins
- 12CarsonSubstituted forMeikleat 86'minutes
- 9FletcherSubstituted forSinclairat 14'minutes
- Gary Sutton
- Shots on Target
Second Half ends, AFC Wimbledon 2, York City 1.
Attempt saved. Michael Coulson (York City) header from the centre of the box is saved in the centre of the goal.
Attempt saved. Sean Rigg (AFC Wimbledon) right footed shot from the centre of the box is saved in the centre of the goal.
Goal! AFC Wimbledon 2, York City 1. Jack Smith (AFC Wimbledon) right footed shot from outside the box to the top left corner.
Foul by Mark Phillips (AFC Wimbledon).
Keith Lowe (York City) wins a free kick in the attacking half.
George Francomb (AFC Wimbledon) wins a free kick in the defensive half.
Foul by Malvind Benning (York City).
Foul by Adebayo Akinfenwa (AFC Wimbledon).
Russell Penn (York City) wins a free kick in the attacking half.
Substitution, York City. Lindon Meikle replaces Josh Carson.
Corner, AFC Wimbledon. Conceded by Russell Penn.
Corner, AFC Wimbledon. Conceded by Keith Lowe.
Substitution, AFC Wimbledon. Craig Tanner replaces Adebayo Azeez.
Attempt saved. Mark Phillips (AFC Wimbledon) header from the centre of the box is saved in the top centre of the goal.
Marvin McCoy (York City) is shown the yellow card.
Adebayo Azeez (AFC Wimbledon) wins a free kick in the defensive half.
Foul by Marvin McCoy (York City).
Attempt missed. Adebayo Akinfenwa (AFC Wimbledon) right footed shot from the centre of the box misses to the right.