Manchester City blew their chance to close ground on Chelsea at the top of the Premier League as Philippe Coutinho's worthy late winner earned Liverpool all three points in a pulsating game at Anfield.
Adam Lallana squandered a good chance to grab an early lead for his side when he could only fire tamely at Joe Hart after collecting Coutinho's defence-splitting through ball.
Barely a minute later, Lallana thought that he had made amends when he delicately controlled Coutinho's near-post cross and flicked the ball into the roof of the next, but his effort was ruled out for offside.
Liverpool did take the lead when Vincent Kompany carelessly lost the ball to Coutinho in middle of the park, allowing the Brazilian to combine with Raheem Sterling to tee up Jordan Henderson, who hammered home a thumping effort from 20 yards.
While they were sloppy at the back, City remained a threat going forward and they could have been level when Sergio Aguero collected David Silva's lofted pass and clipped an effort beyond Simon Mignolet, only to see the ball crash into the far post.
It was Aguero and Silva who again combined to carve out City's equaliser for Edin Dzeko on 25 minutes, with the Bosnian striker coolly turning and firing home from the middle of the Liverpool box.
Lallana could have ended a thrilling first half with a third goal as his volleyed effort from Lazar Markovic's chipped pass flew narrowly wide of Hart's goal.
The second half began as breathlessly as the first ended as Aguero came close to heading his side into the lead when rose highest to meet Pablo Zabaleta's right-wing cross.
Next it was Sterling who spurned a good chance when he could only flick Lallana's cross wide of Hart's goal, before the former Southampton man had a second effort ruled out for offside after meeting Martin Skrtel's knockdown from a free kick.
As the second half wore on, the game continued to swing back and forth. Liverpool were on the front foot and the away side a constant threat on the break.
Still, Brendan Rodgers's side would have felt that all their hard work deserved a winner, and they got one when Coutinho stepped up to curl home from 25 yards.
The goal was every bit the equal of Henderson's first-half effort, and a fitting way for the home side to secure a win that lifts them above Southampton and into fifth place in the Premier League table.