Scott Taylor struck a last-gasp winner to lift Milton Keynes off the bottom of League One for the first time since Christmas as they saw off Hartlepool.
Taylor's 10-yard shot with seconds left cannoned in off the inside of the post to leave the visitors in dire trouble.
MK Dons took a first-half lead, Aaron Wilbraham stabbing home Gary Smith's quick free-kick from close-range.
Hartlepool's Michael Proctor lobbed in to level after Matt Baker appeared to have been fouled before Taylor won it.
Milton Keynes Dons: Baker, Lewington, Morgan, Partridge, Crooks, Smith, Chorley, Mitchell (McLeod 55), Morais (Edds 69), Wilbraham (Taylor 78), Platt.
Subs Not Used: Harding, Webb.
Booked: Partridge.
Goals: Wilbraham 25, Taylor 90.
Hartlepool: Konstantopoulos, Robson, Nelson, Clark, Barron (Darren Williams 69), Humphreys, Tinkler (Llewellyn 81), Turnbull (Clarke 45), Eifion Williams, Istead, Proctor.
Subs Not Used: Boyd, Provett.
Booked: Barron.
Goals: Proctor 50.
Att: 6,472
Ref: S Tanner (Somerset).