Mohamed Salah’s late goal snatched a victory for Liverpool at Crystal Palace and left their hosts two points above the relegation zone.
The Egyptian took a touch before firing past keeper Wayne Hennessey after Andy Robertson had crossed in from the left.
Luka Milivojevic had converted from the spot early in the first half to give Palace the lead after Liverpool keeper Loris Karius took out Wilfried Zaha.
And Sadio Mane turned in James Milner’s cross shortly after the break to level.
Liverpool had plenty of chances to score in the first half at Selhurst Park as Salah’s curling effort tested Hennessey and Mane came close with two headed efforts.
Karius’ early error looked costly as Palace clung on until half-time but Liverpool responded within four minutes of the restart when Milner and Robertson combined down the left to set up Mane.
Christian Benteke then missed two clear goalscoring chances in as many minutes before Patrick van Aanholt’s fizzing free-kick was palmed away by Karius.
There were appeals for Mane to be shown a second yellow card – he was booked for diving in the first half – after he picked up the ball on the edge of the area but referee Neil Swarbrick settled for a free-kick.
The Reds then completed the comeback when Salah scored his 29th Premier League goal of the season – equalling the league record of scoring in 21 matches in a 38-game season.
Liverpool headed to Selhurst Park knowing they have an important week ahead.
The Reds host Manchester City in the first leg of their Champions League quarter-final on Wednesday before making the short trip to Merseyside rivals Everton in next Saturday’s Premier League derby.
But Jurgen Klopp named a strong starting line-up in his 100th Premier League game in charge despite expectations he would rest several key players.
But Liverpool’s first-half performance did not match the boldness of Klopp’s selection as they lacked intensity and imagination against a stubborn Palace defence.
Mane’s equaliser early in the second half was a good response but Benteke missed two great chances moments later to regain Palace’s lead.
Liverpool had further chances and so did Palace but it was Salah who once again came to the rescue – saving the visitors’ blushes.
Victory takes Liverpool up to second place in the Premier League table – at least for a few hours as Manchester United host Swansea at 15:00 BST.
More missed opportunities for Palace
Roy Hodgson’s side suffered yet another defeat against a team in the top six and, having taken an early lead, this was a missed opportunity.
Palace were the better side in the first half and deserved to be in front after Zaha had won a penalty when he was clattered by Karius.
They then defended well – keeping Salah out of action and frustrating Mane.
Even after Liverpool had responded and equalised, Palace grew in confidence and started to create more in attack.
But Benteke missed two golden opportunities to regain the lead and it ultimately proved costly as Salah showed the required prolificacy at the other end.
Former Liverpool striker Benteke has missed 20 of the 22 big chances he has had in the Premier League this season, more than any other player.
Palace have now suffered five defeats in their last six games and are two points above the relegation zone – with their rivals all yet to play.
After throwing away leads against both Manchester United and Liverpool in the space of a month, Salah’s late winner will come as yet another blow to the south London side.
Major blow for Adam Lallana
Adam Lallana has started just one game for Liverpool this season after struggling with injury.
He came on as a second-half substitute at Selhurst Park in the hope of gaining more match fitness following a 30-minute cameo for England on Tuesday.
But it was not what he or Klopp had hoped for when he hobbled off within three minutes of his introduction.
The 29-year-old midfielder has played just 215 minutes of Premier League football this season and now looks set to spend more time on the sidelines.
“It is not good, he is really down in the dressing room,” Klopp said. “It is really difficult, whatever injury it looks like a muscle one.”
Crystal Palace boss Roy Hodgson, speaking to Sky Sports: “It’s very disappointing for them to get the winning goal so close to the end of the game. It’s tough to take.
“It feels like a groundhog day when we play against the top teams. In the second half we played well and controlled the ball and created better chances but we also conceded both goals.”
Liverpool manager Jurgen Klopp, speaking to BBC Sport: “It is usual for us that we need to fight here, especially after a difficult start, but it makes it more special at the end. The win was deserved.
On Mane’s booking for diving: “For me, it’s a penalty, it’s clear. He is 0.1 seconds too late going down, but it’s a penalty. With contact, how can that be a dive? I spoke to the referee at half-time.
“There were a few strange situations today and Mane had to go through 80 minutes of being whistled. It was not a Sadio Mane day today. I thought he would be sent off for handling the ball. I did not understand it but am happy he didn’t.”