Birmingham City had the early Premier League leaders begging for the final whistle before Aaron Lennon nicked a winner for Tottenham deep into stoppage time.
Battling Birmingham showed all of their survival qualities to hit back from going a goal down to Peter Crouch to equalise through Lee Bowyer and should have gone on to win.
But Lennon struck after four minutes of stoppage time when he drilled in a low right-foot shot that beat Joe Hart and left the Blues with nothing to show for their efforts.
Tottenham were the better team but they were still fortunate to win.
Lennon missed first-half chances to give Tottenham the lead and Ledley King also went close while Seb Larsson had Birmingham's best effort.
England hitman Jermain Defoe, substitued late on, was guilty of the worse miss though, when he dragged a shot wide with only Hart to beat.
Tottenham came out for the second half without King, who had picked up an injury and was replaced by Alan Hutton.
Luka Modric jumped in for a foolish challenge on Bowyer and injured himself in the process, a minute after the restart, and ultimately had to be replaced by Crouch, who proceeded to miss five great chances in ten minutes.
If ever a goal was coming it was Crouch's 72nd-minute effort that broke the deadlock and it came, of course, from a header.
Tom Huddlestone delivered a high free-kick to the far post where Crouch rose supremely and nodded the ball back into the opposite corner of the net.
The Tottenham fans celebrated like it was job done, but Blues boss Alex McLeish threw on Christian Benitez for Lee Carsley and Birmingham were back on level terms within three minutes.
The battling Garry O'Connor forced the ball into the box and bungling defender Hutton and keeper Carlo Cudicini hesitated before the ball rebounded for Bowyer to tap in from six yards.
Tottenham were rattled and were hanging on for their lives as O'Connor and then Roger Johnson missed good chances to wrap up all three points.
The home fans did not know whether to laugh or cry when four minutes of stoppage time were signalled, but it ultimately worked in their favour in the final minute of play when Lennon cut in to score with a low right-foot drive.
Birmingham had struggled to get close to Lennon all afternoon and so it proved again when he cut in to fire home with a right-foot shot with 94 minutes showing on the clock.