Mark Arber's 70th minute header and Richards' strike 10 minutes later snatched the points for Keith Alexander's men, to disappoint the Dons' biggest home crowd of the season.
The Dons started brightly and Izale McLeod had a goal ruled out just three minutes in when he curled a quick free-kick into the top corner from the edge of the box, but it was too quick for referee Paul Melin.
McLeod had a 10-yard strike well blocked by Adam Newton, before Clive Platt nipped in at the near post to turn Paul Mitchell's low cross at goal but he was denied by a point-blank save from Posh goalkeeper Mark Tyler in the 10th minute.
Tyler got lucky on the half hour mark when he spilled Aaron Wilbraham's fizzing low drive straight to McLeod, but the red-faced keeper was saved by the offside flag.
Peterborough fought back and Liam Davis diverted Danny Crow's excellent low cross goalwards from close range but Dons' keeper Adolfo Baines saved well, before Jamie Day's cross-shot was desperately clawed over the bar by Baines in the 40th minute.
But the Dons ended the first half on top as Dean Lewington curled a 30-yard free-kick just over the bar and Drissa Diallo headed Lewington's corner over from six yards on the stroke of half-time.
Milton Keynes picked up where they had left off after the break and McLeod stole a yard on Posh defender Guy Branston but his stinging low drive from the edge of the box was saved superbly by Tyler at his near post.
Then from the resulting corner, Ben Chorley's header from Lewington's deep cross shaved the far post in the 64th minute as Posh rode their luck.
And Peterborough substitute Arber made the Dons pay for their misses when he put the visitors ahead in the 70th minute. Jude Stirling launched a long throw into the box and Arber stole in 10 yards out to loop a header over Dons' keeper Baines and into the top corner.
Jon-Paul McGovern curled a 25-yard free-kick inches wide in the 79th minute as the Dons pressed for an equaliser, but substitute Richards doubled Posh's lead 10 minutes from the end.
Richard Butcher's corner was knocked back into the danger zone by Ben Turner for Richards to nod in his first Peterborough goal from six yards.