Steven Gerrard scored a stunning late goal as Liverpool came from behind to beat Olympiakos and go into the next stage of the Champions League.
The visitors went ahead when Rivaldo was brought down after a mazy run and scored from the resulting free-kick.
It left Liverpool needing three to go through and Florent Sinama Pongolle converted Harry Kewell's cross before Neil Mellor stabbed in from six yards.
Mellor teed up Gerrard to lash in from 25 yards to win it in brilliant style.
Liverpool came flying out of the blocks and had three corners in the first two minutes, one of which resulted in a disallowed goal from Baros for pushing on Giorgos Anatolakis.
Soon after, yet another Gerrard corner landed on Hyypia's head and the Finn will have been disappointed to direct his effort wide from six yards.
But their early momentum did not last long and the Greeks eventually began to keep the ball to frustrate the Anfield crowd, Rivaldo and Predrag Djordjevic the two most influential figures.
Rivaldo's free-kick flicked off Gerrard's head and flew over Kirkland's crossbar before Liverpool replied as Baros got the slightest flick on a left-wing cross to divert the ball onto Nikopolidis' post.
Rivaldo was beginning to stretch the Reds' defence and he manufactured a goal out of sheer brilliance to knock the stuffing out of Rafael Benitez's side.
The Brazilian skipped past four players before Hyypia brought him down 20 yards out, and Rivaldo stepped up to curl the free-kick home, though in truth the Liverpool wall parting like the Red Sea did Kirkland no favours.
Another Rivaldo run ended with a foul from Jamie Carragher that the referee deemed worthy of a yellow card, Djordjevic lashing the set-piece into the arms of Kirkland.
Benitez brought on Pongolle for Djimi Traore at the interval and it paid immediate dividends, the young French striker arriving at the near post to convert Kewell's cross to give the hosts renewed hope.
The Greeks refused to buckle and the game became heated with several off-the-ball clashes, Gerrard being booked for a wild kick that could have seen him dismissed.
But the captain was everywhere, desperately trying to haul his side back into it, and he was unlucky to see a 25-yard volley ruled out for a Baros' foul on Gabriel Schurrer.
Sadly for Gerrard, his team-mates were not up to the same standard, Kewell heading straight at Nikopolidis from five yards when it looked easier to score.
Having seen Pongolle make an immediate impact, Benitez tried his luck with Mellor and the young striker stepped off the bench to lash in a rebound to set up a grandstand finish with 10 minutes left.
Both Mellor and Pongolle had penalty appeals turned down as Liverpool drove on for that crucial third, but it was left to Gerrard, with the script written, to put them into the knockout stages.
Mellor set the 24-year-old up outside the area and he fired in a thrilling drive past Nikopolidis' despairing dive to sent the crowd into raptures.
Perhaps Liverpool could count themselves fortunate on the night, but for Gerrard it was nothing less than he deserved.
Liverpool: Kirkland, Finnan (Josemi 85), Carragher, Hyypia, Traore (Sinama Pongolle 45), Nunez, Alonso, Gerrard, Riise, Kewell, Baros (Mellor 78).
Subs Not Used: Dudek, Henchoz, Diao, Warnock.
Booked: Alonso, Carragher, Gerrard.
Goals: Sinama Pongolle 47, Mellor 81, Gerrard 86.
Olympiakos: Nikopolidis, Pantos, Anatolakis, Schurrer, Venetidis (Maric 84), Georgiadis (Rezic 70), Kafes, Stoltidis, Djordjevic, Rivaldo, Giovanni (Okkas 87).
Subs Not Used: Giannou, Kouloucheris, Castillo, Vallas.
Booked: Pantos, Schurrer.
Goals: Rivaldo 26.
Ref: Manuel Enrique Mejuto Gonzalez (Spain).