John Arne Riise's injury-time own goal gave Chelsea the advantage in their Champions League semi-final.
Dirk Kuyt's close-range finish three minutes before the interval looked to have secured Liverpool a slender lead.
And it took fine saves from Petr Cech to deny Steven Gerrard and Fernando Torres as Liverpool threatened to put the tie out of Chelsea's reach.
But Riise headed in Salomon Kalou's cross five minutes into injury time to give Chelsea a priceless away goal.
It was an incredible finish to an absorbing match which leaves Chelsea as slight favourites to progress in next Wednesday's second leg at Stamford Bridge.
Chelsea boss Avram Grant surprisingly gave Florent Malouda the nod on the left flank, while Liverpool dropped Sami Hyypia and drafted in Alvaro Arbeloa.
In a typically cagey start, Chelsea had more of the possession but Liverpool carved out the clearer opportunities.
Liverpool captain Steven Gerrard shot straight at Cech after seven minutes, then Kuyt's poor control let him down after he was sent clear by Xabi Alonso, allowing the Chelsea keeper to make the clearance.
Joe Cole wasted Chelsea's best opportunity when he was sent clear in the area, but he failed to realise the amount of time he had and the chance was gone.
Chelsea had penalty appeals waved away when Didier Drogba tumbled under Jamie Carragher's challenge before Torres was denied by a brilliant save from Cech.
The Spanish marksman was cleverly played in by Gerrard, but Cech was alert and came out to make a crucial block.
But he was powerless when Liverpool took advantage of a catalogue of defensive errors to take the lead two minutes before half-time.
Chelsea were caught out by Alonso's quick free-kick and when Lampard failed to clear, Kuyt stole in on the end of Javier Mascherano's mis-kick to steer the finish past Cech.
The goal gave Liverpool a further injection of confidence and they dominated the early stages of the second half, with Ryan Babel fizzing a 25-yard shot just wide after 58 minutes.
Chelsea needed to regain a foothold in the game, and boss Grant made a change to send on Kalou for the subdued Joe Cole.
Liverpool keeper Pepe Reina had been virtually unemployed, but he was in action after 66 minutes when Michael Ballack headed on Lampard's free-kick.
And it then took a vital interception from Mascherano to block Malouda after Lampard carved open the Liverpool defence.
Chelsea had shown greater purpose in the latter stages, but once again Liverpool's trademark defensive resilience had kept them at bay.
And with six minutes left they broke the shackles and Cech needed to produce a stunning stop to turn Gerrard's rising volley over the bar.
Cech made another fine block from Torres in injury-time - and its value was emphasised by dramatic events seconds later.
Kalou's cross sparked uncertainty in the six-yard area and Riise, in two minds, sent a spectacular flying header into the top corner at the Kop end.
Liverpool: Reina, Arbeloa, Carragher, Skrtel, Aurelio (Riise 61), Kuyt, Alonso, Mascherano, Babel (Benayoun 75), Gerrard, Torres.Subs Not Used: Itandje, Hyypia, Crouch, Pennant, Lucas.
Goals: Kuyt 43.
Chelsea: Cech, Ferreira, Carvalho, Terry, Ashley Cole, Lampard, Makelele, Ballack (Anelka 86), Joe Cole (Kalou 63), Drogba, Malouda.Subs Not Used: Hilario, Shevchenko, Obi, Alex, Belletti.
Goals: Riise 90 og.
Ref: Konrad Plautz (Austria).