Bolton: Philippe Coutinho struck a stoppage-time winner for Liverpool as they beat Bolton 2-1 in the FA Cup fourth round replay on Wednesday.
Last season's Premier League runners-up were on the verge of exiting the competition after Eidur Gudjohnsen converted a second-half penalty in the 59th minute.
However, Raheem Sterling struck in the 86th and within minutes the Brazilian settled the match with a strike from outside the box, in the week that saw him pen a new long-term deal with the Anfield club.
"It was always going to be a tough game. Going 1-0 behind away from home put us on the back foot. You have to keep your patience and keep the width in the game, especially against 10 men," said Liverpool manager Brendan Rodgers.
The game marked captain Steven Gerrard's 700th appearance for the Merseysiders and it was the visitors that dominated in a first half which saw Sterling strike the outside of the post shortly before the interval.
Yet it was the hosts that took the lead courtesy of Gudjohnsen's spot kick after Martin Skrtel was penalized for a challenge on youngster Zach Clough.
Bolton were reduced to 10 men minutes later when Neil Danns was shown a second yellow for a late challenge on Joe Allen in the 66th.
Liverpool pressed for an equaliser but were foiled by a stubborn Bolton defense, which came within minutes of dumping Rodgers' side out of the competition.
Following Danns' dismissal, Rodgers moved Emre Can forward from centre back into a central midfield role. That moved paid dividends. The German youngster picked out Sterling with a lofted pass that the England international netted on the volley.
With extra time looming, Coutinho curled a right-footed shot beyond goalkeeper Andy Lonergan to see off a spirited performance from Neil Lennon's side.
"I was thinking when it went 1-0 and hit the woodwork so many times that it's not our day but the boys stuck in really well and got the goals that we deserved and won the game," said Liverpool's opening scorer Sterling.
Liverpool will now face Crystal Palace in the fifth round at Selhurst Park.