A late Dirk Kuyt header booked Liverpool's place in the last 16 of the Europa League as the Reds overcame a stubborn Sparta Prague at Anfield.
Kuyt guided in an 86th minute Raul Meireles corner as the home side finally converted one of their chances.
Sotirios Kyrgiakos had earlier been denied for Liverpool when keeper Jaromir Blazek clawed away his header.
Meireles blazed over and David Ngog had an effort saved for the Reds before Kuyt provided the finish needed.
Joe Cole raced clear and could have put the gloss on the victory as Sparta left spaces at the back in search of a leveller but the playmaker put his shot wide with just Blazek to beat.
Nevertheless, Liverpool prevailed to provide manager Kenny Dalglish with victory in his first European game in charge of the club at Anfield and set up a last 16 encounter against Portuguese outfit SC Braga.
Dalglish, however, will feel his side's progress should have been confirmed much earlier at a sell-out Anfield.
Following an uneventful goalless first leg, both teams showed more ambition this time around and the increased sense of urgency, blended with some sloppy play, made for an entertaining spectacle.
The Reds might have had a penalty as early as the opening minute when a Meireles free-kick bounced on to Manuel Pamic's hand, with the home side's appeals for handball being waved away.
The visitors hit back when a long throw fell for Libor Sionko and he poked an effort high as he was quickly closed down by Liverpool keeper Pepe Reina.
Vaclav Kadlec shot over and also had a powered header saved within the first 15 minutes as Sparta strived for an away goal which would have given them the upper hand.
The warning signs were heeded by Liverpool and a guided header by Kyrgiakos from a Meireles corner almost crept in before Blazek scrambled across to save.
This last 32 tie has come during the winter break in Sparta Prague's domestic season and their lack of action might have been behind Sionko and Kadlec failing to take a gilt-edged opening.
The pair appeared to get in each others way as a corner fell to them at the far post following Reina missing an attempted punch clear.
Liverpool had little excuse for their failure to take their chances as Meireles, who has been on such a rich goalscoring vein, blazed a half-volley high from a Martin Kelly cross.
Cole cut inside and had a shot blocked away by Blazek before Sparta right-back and ex-West Ham defender Tomas Repka's mistake opened the door for the Reds.
Kuyt got in behind Repka and pulled the ball back for Ngog, whose disappointing shot was straight at Blazek.
Lucas fizzed a 25-yard shot just wide of the Sparta goal and, while Ngog was working tirelessly, he could not find the finish to reward his play as he was again denied by the visiting keeper.
The prospect of an away goal late on to leave Liverpool with little time to respond would have caused anxiety among the home fans but that was all relieved when Kuyt got on the end of a Meireles corner as extra-time loomed.