Jonson Clarke-Harris struck his most important goal of all to earn Peterborough promotion after a stunning comeback to earn a 3-3 draw against Lincoln.
Posh slumped to a three-goal deficit before roaring back to book their place in the Championship and seal a fourth rise under boss Darren Ferguson as Clarke-Harris tucked away a last-gasp spot-kick.
Anthony Scully headed City into a 31st-minute lead before Jorge Grant doubled the advantage from the penalty spot in first-half stoppage time after Morgan Rogers was sent tumbling by Nathan Thompson.
City looked set to have sealed victory when Scully struck again from 20 yards eight minutes into the second half, but Posh came roaring back.
Siriki Dembele began the revival in the 65th minute before Clarke-Harris struck with a deflected free-kick after 76 minutes.
Newly-crowned League One Player of the Year Clarke-Harris then hit the bar with a header before Posh were handed one final chance when referee John Busby pointed to the penalty spot in the sixth minute of added time.
Scully went from hero to villain when bringing down Sammie Szmodics and Clarke-Harris lashed home his 31st league goal of a spectacular campaign to send Posh up and leave City facing the play-offs.
Ferguson: Promotion unbelievable
"It's absolutely incredible," said Peterborough boss Darren Ferguson. "I've never seen anything like it. This club means so much to me and there is no doubt this is the best promotion I've ever had.
"I don't mind admitting I got quite emotional after such a tough couple of seasons. We worked too hard for it to blow it. I had all sorts going through my mind at 3-0 down, but what a bunch of players I have. To do what they did in a game of such magnitude is fantastic.
"I always felt we could come back if we just got one goal. We did that and then after the second goal I thought we would go on to win it, never mind draw. That didn't happen and we ended up hoping for one more chance. When it came I knew Jonson was going to score.
"The boy has been an unbelievable signing. To smash the penalty in the way he did under that much pressure was brilliant. We're in the Championship again and we'll be trying our best to stay there."