Toby Alderweireld's late own goal gave Liverpool a priceless 2-1 victory and put them back on top of the Premier League.
Mo Salah's 89th-minute header rebounded from the hands of Tottenham goalkeeper Hugo Lloris and off Alderweireld to earn victory for Juergen Klopp's side at Anfield on Monday (NZT).
The win puts Liverpool two points clear of Manchester City at the top, as they chase their first English Premier League title since 1990.
However, Manchester City still have a game in hand.
Liverpool thought they had spurned the chance of victory when Lucas Moura equalised on 70 minutes after Roberto Firmino headed the opening goal on 17 minutes.
Klopp threw on Divock Origi and Fabinho in search of a winner, but it was Salah's contribution, with help from Lloris and Alderweireld, that grabbed all three points for the home side.
In the day's other match, Chelsea boosted their top-four hopes thanks to a controversial 2-1 win at Cardiff City.
Ruben Loftus-Cheek headed the winner in the 90th minute to put sixth-placed Chelsea within one point of third-placed Tottenham and fourth-placed Manchester United.
Victor Camarasa put Cardiff in front, but Cezar Azpilcueta equalised, despite being offside, before Loftus-Cheek won it to leave Cardiff still third-bottom, five points from safety.
Cardiff manager Neil Warnock was furious with the referee's decisions, including two penalties he felt his side should have had.
"I am deflated because we have worked hard for this game and felt we could win it," he said.
"When you don't win, and it is nothing to do with ourselves it is a kick in the teeth.
"Against the big teams, you have to have VAR because you don't get the big decisions.
"The equalising goal is the winning goal really, and if you can't see across the line and see offside, I don't know why we are in the game."
Cardiff are now up against it in their fight for survival, but Warnock said he could not have asked for more from his players.
"They were brilliant, and it made for a great game," he said.
"It kicks you in the teeth. We've had enough of them this year."
Chelsea manager Mauricio Sarri was glad of the three points.
"They were probably unhappy for the result. I can understand, I can understand very well," he said.
"I am getting used to this."
"In the end, we deserved to win. I don't know if the goal was offside. I have to see the situation and the action, I don't know. Maybe. Sometimes we can be lucky."
Arsenal can go third if they beat Newcastle in Tuesday's (NZT) match.