Fernando Torres' double proved key to Liverpool's win over Porto to keep alive their Champions League hopes.
Torres scored his first Champions League goals for Liverpool
Torres headed in Steven Gerrard's corner to give Liverpool the lead, but Porto equalised with a header of their own, Lisandro Lopez nodding home.
Liverpool huffed and puffed in search of the second goal and on 78 minutes Torres curled a shot into the net.
Steven Gerrard's penalty made it 3-1 after Milan Stepanov's handball, with Peter Crouch heading in a fourth.
Liverpool must now beat Marseille in their final Group A game on 11 December to guarantee they will reach the knockout stages, but if Besitkas beat Porto a draw in France could be enough.
The scoreline suggests Liverpool won this game with something to spare but that was never the case and it was only with Torres' second goal that the home side began to breathe more easily.
Too many passes went astray and there was little of the pizzazz that had been on show in Saturday's 3-0 away win over Newcastle.
Ahead of the game over 2,000 fans had marched to Anfield from a nearby pub in support of manager Rafael Benitez over his very public row with club owners Tom Hicks and George Gillett.
During the game there were plenty of supportive chants for Benitez and the crowd's mood was improved immeasurably by Torres' first goal.
When Porto rewatch the video of that goal, Stepanov and Lucho Gonzalez will want to avert their gaze.
As Gerrard swung over a corner Stepanov and Gonzalez could not make up their minds as to who should mark Torres.
The former Atletico Madrid striker needed no second invitation and proceeded to guide a downward header past Porto goalkeeper Helton.
Anfield might have been hoping for a reprise of the 8-0 thrashing of Besiktas in Liverpool's previous Champions League home game, but Porto had other ideas.
Torres scores his first goal of the game
Przemyslaw Kazmierczak was allowed to cross from the left and Lopez got the better of Alvaro Arbeloa and powered a header past Pepe Reina.
That goal unsettled Liverpool and Lopez should have put Porto ahead when, with just Reina to beat, he put the ball narrowly wide of the post.
Torres was quickly back to work in the early stages of the second half, setting up Yossi Benayoun, but the Israeli international badly miscued his shot.
The desperate need for three points clearly got to Liverpool, and devoid of rhythm, chances began to dry up.
Benitez introduced Harry Kewell and Crouch and both of them played key roles in Liverpool's rousing finale.
Kewell dribbled the ball to the area before Torres took over, bending the ball round Helton.
After Torres' second goal, Porto imploded.
Stepanov gave Liverpool a penalty by handling a Gerrard free-kick and the England midfielder's spot-kick was precisely placed in the corner as he wrongfooted Helton.
Another corner provided Liverpool's fourth, Gerrard swinging over the ball from the right and Crouch towering over the Porto defence to head in.
Liverpool: Reina, Finnan, Carragher, Hyypia, Arbeloa, Benayoun (Crouch 71), Gerrard, Mascherano, Babel (Kuyt 85), Voronin (Kewell 63), Torres.
Subs Not Used: Itandje, Riise, Lucas, Sissoko.
Goals: Torres 19, 78, Gerrard 84 pen, Crouch 88.
FC Porto: Helton, Bosingwa, Stepanov, Bruno Alves, Cech, Mariano Gonzalez (Sektioui 77), Lucho Gonzalez, Paulo Assuncao (Postiga 81), Kazmierczak (Raul Meireles 65), Quaresma, Lopez.
Subs Not Used: Nuno, Pedro Emanuel, Fucile, Bolatti.
Booked: Paulo Assuncao, Stepanov, Quaresma.
Goals: Lopez 33.
Ref: Roberto Rosetti (Italy).