Philippe Coutinho scored a brilliant first goal of the season and Jamie Vardy had a penalty saved as Liverpool survived a Leicester fightback to end their run of four games without a win.
The Foxes won 2-0 in their Carabao Cup third-round meeting on Tuesday, but the Reds exacted revenge on their return to Premier League action.
Coutinho set up Mohamed Salah for the opener and then struck a majestic free-kick to give his side a two-goal lead at King Power Stadium.
But Shinji Okazaki poked home from close range just before the break to give Leicester hope, before a frantic five-minute spell in the second half saw the balance of the game fluctuate dramatically.
Jordan Henderson netted from a Liverpool counter attack to make it 3-1 and seemingly secure the points but the hosts responded a minute later when Vardy headed into an empty net after Simon Mignolet pushed Demarai Gray’s shot into his path.
Vardy then earned a penalty when he was brought down by Mignolet, but the Belgian kept out the England striker’s spot-kick, which followed his usual tactic of going straight down the middle.
Liverpool had few further scares to survive as they held on for a timely victory after a modest run of form, the win moving Jurgen Klopp’s side up to fifth in the table.
Leicester remain just above the relegation zone with merely a win and a draw from their opening seven matches.
Many Liverpool fans were resigned to never seeing Coutinho in a red shirt again after he handed in a transfer request over the summer, with Spanish giants Barcelona chasing his signature.
But Liverpool would not sanction his £114m move and, on his second Premier League start of the season, he showed the key part he still has to play for Klopp’s side.
The former Inter Milan playmaker’s deep cross from the edge of the box was perfectly flighted for summer signing Salah to head in at the far post, with Foxes keeper Kasper Schmeichel caught out by the Egypt winger’s neat finish.
In contrast, Schmeichel had no chance of stopping the Brazilian’s free-kick, which bent beautifully around the wall and into the corner of the net.
It looked like Coutinho’s magnificent first-half performance would be the talking point, but as ever with a Liverpool team that struggles to defend with assurance, there was more drama to follow.
Prior to this match, Liverpool had lost 20 points from winning positions since the start of last season and it looked like Vardy was going to haunt them once again.
The England striker had scored two goals in each of his last two appearances against the Reds, but he was denied an equaliser and another double by a smart penalty save from Mignolet, who had conceded the penalty despite making contact with the ball before he clattered into the home striker.
Liverpool boss Klopp has faced plenty of criticism over their recent form – which has seen them draw two and lose two in all competitions since the emphatic win over Arsenal – and he celebrated with trademark gusto at the final whistle after picking up all three points.
“I really think in a moment like this so many things are positive,” he said. “The three points are the proof for the public that we are still here, everything is good. Let’s make the next step together.”
Craig Shakespeare’s first match as Leicester manager back in February was a win over Liverpool and his Foxes side were surely buoyed by their cup victory on Tuesday.
Their game plan will have focused on exposing the Reds’ well-documented defensive frailties and it almost worked.
Vardy was a constant menace and it was no surprise when he got his customary goal, while Liverpool’s vulnerability when defending crosses was exposed for Okazaki’s scrambled effort.
The England forward was again causing alarm in the visiting defence when his blocked effort led to Henderson’s cool finish on a counter attack orchestrated by substitute Daniel Sturridge.
Shakespeare said: “I am struggling to digest it myself. You come in after contributing to another fabulous game of football but ultimately we’ve come away with nothing.
“The disappointing thing for me was at 2-1 down we conceded a third goal. It was a difficult game for us – it ebbed and flowed but we go away disappointed.”