Peterborough 1-0 Sheffield Wed
Grant McCann's stunning free-kick lifted Peterborough out of the relegation zone and stopped Sheffield Wednesday from securing their safety.
Dwight Gayle forced a save from Owls keeper Chris Kirkland before Anthony Gardner headed wide for Wednesday.
McCann struck a long-range free-kick after the break that found the net via the post to hand the hosts the victory.
Darren Ferguson's side are now out of the bottom three on goal difference while the Owls sit a point clear.
Peterborough go back ahead of Barnsley, who beat Hull earlier on Saturday, on goal difference in the table heading into their final game of the season at Crystal Palace.
Wednesday now have to beat Middlesbrough at home on the final day to ensure they remain in the second tier.
A point would have been enough to secure Wednesday's Championship status and they came close to taking the lead when a high free-kick dropped to Seyi Olofinjana but a brave block from Gabriel Zakuani denied the Owls.
Gayle then had a chance to get his 14th goal for Posh but his low effort was easily saved by Wednesday keeper Kirkland.
As the break approached, Dave Jones's side thought they had the lead when Gardner met Danny Pugh's corner but his header was just wide.
After half-time, Gayle was lively again but this time Miguel Llera blocked his shot inside the area and referee Nigel Miller waved away pleas for handball.
The opener came just after the hour mark when McCann stepped up to fire in a powerful free-kick off the post.
Leroy Lita, Lewis Buxton and Gardner all missed late chances for the Owls but Peterborough held on and their survival hopes remain in their own hands.
Peterborough manager Darren Ferguson:
"Great players always perform in the big games and Grant does that for us.
"We've done our job this weekend but we have another big one to do next weekend. I've felt for a while that it would go all the way to the final day of the season and that's how it has panned out.
"We're in a good position in so much as we know that if we match Barnsley's result, we'll stay up. I've got a fantastic bunch of lads and have never once questioned their commitment. Yes, they make the odd mistake, but they are only human."
Sheffield Wednesday manager Dave Jones:
"There were a lot of nervous people out there on the pitch and it was always going to take something special to win the game.
"We didn't do any better or worse than Peterborough did, but they had that one moment that mattered. It was sloppy on our part to concede the free-kick.
"There are several teams still in danger but our destiny is in our own hands and that is what is important. We're not in the position of having to rely on other results.
"Staying in this league will be a far bigger achievement than winning promotion last season to get here."