It was a nervy start for Peterborough United, but the home team settled down within the first fifteen minutes, hoping to secure those all-important points to get them to the Championship next season.
Jack Taylor saw an attempt from outside the box blocked in the 21st minute, while a shot from Sammie Szmodics was saved five minutes later, with subsequent Posh appeals for an Imps handball ignored.
It was Lincoln City's Anthony Scully who opened the scoring on 31 minutes, unmarked and heading it over the line from very close range.
All first-half attempts from Posh – from Reece Brown, Siriki Dembele and the newly-crowned League One Player of the Season Jonson Clarke-Harris – were fruitless, and it was an Imps penalty that rounded out the first 45. Conceded by Nathan Thompson, Jorge Grant's right-footed strike took the visitors into the dressing rooms with the lead they needed to stay in the hunt for automatic promotion.
Posh came out needing to fight in the second half, and they began it by winning a free kick – but missed the attempt it offered. Further despair arrived when a brilliant right-footed shot from Scully gave Lincoln their third.
But, with promotion on the line, the home side didn't give up. Dembele sank the ball from the near post five minutes beyond the hour mark, assisted by Dan Butler, and a deflected free kick shot from Clarke-Harris added to Peterborough's tally on the 75th minute, not long after a huge attempt was missed by Imps striker Tom Hopper.
Knowing a draw would clinch it, Posh kept pressing forward with chances from Dembele, Kent and Clarke-Harris all failing to hit the target.
Fate intervened in Posh's favour with a penalty kick conceded when Imps hero Scully brought down Szmodics in the sixth minute of injury time. It was converted by Jonson Clarke-Harris to bring Peterborough level and ensure the point they needed to be playing Championship football next season. He received a yellow card for excessive celebration straight after, but with next to no time for Lincoln to reclaim the lead he's unlikely to have much complaint.
The result means that Posh are back in the Championship for the first time since 2013, with a game still to play. Lincoln City have confirmed their spot in the play-offs.