It needed a Steven Gerrard penalty to make sure Liverpool did not waste the tremendous victory they achieved at Chelsea at the weekend.
That win put Liverpool top of the Barclays Premier League, and a slip-up tonight against Portsmouth would have been a disaster for the Anfield men.
Tony Adams, in his first match in command of Pompey following Harry Redknapp's departure, saw his side push Liverpool all the way.
But Gerrard's spot-kick with 15 minutes left kept Liverpool top and extended their unbeaten run to 16 matches this season.
Liverpool made four changes from the side that claimed top spot in the Premier League by beating Chelsea on Sunday.
Daniel Agger, Javier Mascherano, Robbie Keane and Albert Riera were all rested to the bench, with Sami Hyypia, Jermaine Pennant, Ryan Babel and Lucas coming into the side.
New Pompey boss Tony Adams also made changes from the side that drew with Fulham last time out.
Jermain Defoe and Richard Hughes were on the bench, with Sean Davis and John Utaka in midfield and former Liverpool striker Peter Crouch on his own up front.
There was an air of expectancy around Anfield following the Stamford Bridge success and Liverpool had Pompey under pressure from the start with some fine, flowing, football - much of which was aimed at getting Pennant into space on the right.
The passing was quick and the movement the same, with Liverpool looking like they were going to grab the lead plenty of times in the opening spell.
After 10 minutes Pennant and Alvaro Arbeloa combined to find Dirk Kuyt just outside the box, and his fierce low drive was superbly turned away and onto a post by David James.
Lucas saw a header fly over the bar and Xabi Alonso sent a 20-yarder swerving wide of the left-hand post.
But slowly, Pompey's resilience took the edge from Liverpool's approach play.
Crouch was the sole target for much of Pompey's forward movement, winning consistently in the air but missing his strike-partner Defoe.
The visitors' first chance was headed wide by Younes Kaboul from Lassana Diarra's free-kick, and then Papa Bouba Diop missed a sitter.
Diarra's chip found the big midfielder unmarked six yards out, but he planted his free header straight into Jose Reina's grateful hands.
Liverpool responded with a Gerrard shot into the wall from a tapped free-kick, the ball dropping for Jamie Carragher to test James from 25 yards.
Kuyt had a couple more chances in the half, but Liverpool ended the first-half looking for inspiration.
Portsmouth were beginning to look comfortable, Sylvain Distin and Kaboul assured at the back.
Then after 75 minutes Liverpool got their breakthrough. Hyypia's header from Fabio Aurelio's corner was goalbound before Bouba Diop threw two arms into the flight of the ball.
Somerset referee Steve Tanner booked the Pompey midfielder and pointed to the spot, before Gerrard drove home the penalty.