Finn Talley's sudden death spot-kick save from Connor McLennan earned League One Peterborough a dramatic 5-4 penalty shootout win over gallant League Two rivals Salford in their FA Cup first-round replay.
But Darren Ferguson's side were seconds from a shock first-round exit until substitute Jonson Clarke-Harris equalised in time added on at the end of extra time.
Ammies skipper Alex Cairns then saved two penalties, giving Elliot Watt the chance to win it for the fourth-tier side.
Instead, Watt's kick hit a post and Archie Collins' success from 12 yards and Talley's save sent Posh through to a second-round home meeting with Doncaster.
Only 1,030 were in attendance, but those at Moor Lane were treated to a thrill a minute.
Defender Curtis Tilt headed Salford in front early but Posh hit back through Joel Randall, Ephron Mason-Clark and Collins.
A double interval change, including the substitution of 14-goal top scorer Matt Smith, proved a masterstroke by Salford manager Neil Wood.
Tilt headed in his second of the night from Watt's corner after 54 minutes to revive Salford hopes.
And the teams were level again seven minutes later as defender Josh Knight turned Conor McAleny's cross into his own goal.
Stevie Mallan looked to have snatched a famous win for Salford in the 114th minute, before Clarke-Harris earned the visitors a penalty shootout reprieve.
Report supplied by PA Media.