Liverpool maintained their push for fourth place with a hard-fought win at struggling Portsmouth.
Fernando Morientes put them in front after just four minutes with a stabbed effort from close range.
Pompey answered with Diomansy Kamara scrambling it in after Steve Finnan had blocked Arjen De Zeeuw's header.
But on the stroke of half-time John Arne Riise crossed for Luis Garcia to head past Jamie Ashdown and leave Pompey still not safe from the drop.
It could have been different had an offside flag not denied the home side an opener after just 40 seconds.
Lomana LuaLua got behind the Liverpool backline before rounding Jerzy Dudek and slotting home but the striker was ruled offside.
In a frantic start to the game Milan Baros took a deep cross on his chest and was allowed to walk almost unmarked into the area before he was denied by an onrushing Jamie Ashdown.
Baros made amends moments later when he started the move that led to the opening goal.
His neat flick set Riise on a run into the box and he cut the ball back for Morientes, who managed to stab the ball in despite being on the floor.
Despite their poor start Pompey gradually took control of the game.
But Liverpool still looked just as likely to add to the scoreline and a Finnan cross found Morientes wide open, but with time and space to pick his spot he powered his header over the bar.
Portsmouth got back on level terms when a Matt Taylor corner was met with a powerful header by De Zeeuw, which was blocked by Finnan but Kamara bundled home.
Kamara could have edged Pompey added after a the lively LuaLua ran straight at the Reds defence and slipped in his strike partner but Dudek came out quickly to block with legs.
Liverpool threatened with the influential Riise just guiding a left-foot half volley the wrong side of the post.
The Norwegian turned creator when he picked up a Baros lay-off and played a first-time cross for Luis Garcia to plant a low header past Ashdown.
Riise should have given Liverpool some breathing space after the break when the Pompey defence allowed him space in front of goal but he failed to connect cleanly with his right-foot shot and Ashdown saved with his feet.
Steve Stone missed a glaring chance to level for Pompey when he found himself unmarked five yards out but he made a hash of Gary O'Neil's centre.
Patrick Berger came off the bench against his own side and was denied an equaliser by a full-stretch Dudek.
Liverpool's Xabi Alonso almost capped a fine display with a late third but Ashdown again saved well.
It made little difference as Liverpoolheld on for only their fifth league win on their travels this season.
Portsmouth boss Alain Perrin:
"We played a good game and the players fought well but we needed luck because we had some chances.
"The performance was good. We need three or four points - we wanted to take some this evening and now we will think about the next game.
"The Southampton game is very important for the fans and we know we need the points. It's two teams who want to avoid relegation so it will be like a cup game."
Liverpool boss Rafael Benitez on finishing fourth:
"Everton's win over Manchester United makes it a bit more difficult for us but we can't control what happens on other pitches. We need to win and we've done that.
"All we know is we need to collect three more points than Everton in our last four games. Our idea is to win at Crystal Palace on Saturday and hope we reduce the gap. Twelve points is a lot to play for.
"We deserved this win and controlled the game - we should have scored more. We had so many chances and John Arne Riise could have had a hat-trick."
Portsmouth: Ashdown, Cisse, Stefanovic, De Zeeuw, Taylor, Stone, Skopelitis, Hughes, O'Neil, Kamara, LuaLua. Subs: Hislop, Primus, Fuller, Berger, Rodic.
Liverpool: Dudek, Finnan, Hyypia, Carragher, Traore, Luis Garcia, Alonso, Biscan, Riise, Baros, Morientes. Subs: Gerrard, Cisse, Smicer, Pellegrino, Carson.
Referee: H Webb (S Yorkshire).