An injury time goal decided a nine-goal thriller in favour of Bradford City.
Earlier Tranmere had pulled themselves back from the brink with two goals in the last 10 minutes after a double substitution.
Bradford were the better side in the first half. Ben Muirhead was unlucky to hit a post in the fifth minute before midfield star Steven Schumacher put them in front in the 33rd minute from Dele Adebola's cross.
Tranmere levelled from the penalty spot in the 45th minute. Ryan Taylor was the marksman after Eugene Dadi had been pushed off the ball by Mark Bower.
Nicky Summerbee showed his class with a tremendous 30-yard free-kick into the top right-hand corner to put Bradford back in front in the 53rd minute, but 13 minutes later Iain Hume responded with a tremendous 30-yard drive for the Merseysiders.
It needed a tremendous save from home keeper John Achterberg to deny Schumacher in the 70th minute, but Tom Kearney was first to the rebound and set up Dean Windass for goal number three as Tranmere looked in vain for the offside flag.
Muirhead scored a remarkable solo goal in the 81st minute with a great shot from the edge of the box after a 50-yard run and it looked all over.
But 60 seconds later substitute David Beresford headed a simple third for Tranmere from a Paul Hall cross.
Then in the 87th minute a power header from Hulme from Taylor's pass looked to have earned Rovers a point.
But in the third minute of injury time Summerbee delivered a pin-point free-kick and David Wetherall was on hand at the far post to head in a dramatic winner.