Liverpool have moved level on points with third-placed Manchester United in the Premier League table courtesy of a 2-1 win over Burnley at Turf Moor on New Year's Day.
Burnley's Johann Berg Gudmundsson netted three minutes from time to cancel out a strike from Sadio Mane, but Ragnar Klavan came up with a 94th-minute winner for the visitors.
Burnley boss Sean Dyche made just the one change from the team that started against Huddersfield Town on Saturday, and it was a big one as key centre-back James Tarkowski returned from suspension.
As for Liverpool, neither Philippe Coutinho nor Mohamed Salah were in the squad, while Roberto Firmino started on the bench. Adam Lallana came in for his first Premier League start of the season, and there were also spots in the XI for Alex Oxlade-Chamberlain and Dominic Solanke.
It was the visitors that had the first half-chance of the match in the second minute, but Lallana sent his effort into the stands after an exchange with Oxlade-Chamberlain.
Ashley Barnes had Burnley's first sight of the Liverpool goal in the ninth minute after finding space inside the box, but the attacker missed the crossbar with a wild attempt.
Oxlade-Chamberlain was next to come close for the away side in the 17th minute, but the England international saw his powerful effort pushed away by Burnley goalkeeper Nick Pope.
Scott Arfield headed into the arms of Simon Mignolet in the 28th minute as both sides continued to create half-chances, with Mane twice missing the target from dangerous positions in the latter stages of the first period.
Liverpool were the team pressing for the opening goal as the first half drew to a close, but Solanke's touch let him down on more than one occasion, while Arfield just missed the post with an effort for the hosts in the 38th minute.
Georginio Wijnaldum headed over the Burnley crossbar early in the second period as Liverpool threatened to make the breakthrough.
The Reds were the team firmly on the front foot, and their goal eventually came in the 61st minute when Mane collected a cross from Trent Alexander-Arnold before smashing an unstoppable effort into the top corner of the net.
Sam Vokes came off the Burnley bench for the final 20 minutes, while Firmino was introduced for the away side.
Liverpool continued to threaten as Alexander-Arnold brought a smart save from Pope in the 74th minute, but Burnley were having half-chances of their own - Barnes just missing the far post in the 80th minute.
Pope made another smart save to deny Oxlade-Chamberlain five minutes from time, before Mignolet kept out Vokes down the other end as both teams looked for the game's second goal.
It was Burnley that ultimately scored it as Gudmundsson headed home from close range in the 87th minute after Liverpool had failed to deal with a deflected cross from the left.
Liverpool were not to be denied, however, and nicked all three points in the 94th minute when Klavan met a flick from fellow centre-back Dejan Lovren at the far post to secure a vital win for the visitors.
Burnley (4-5-1): Pope; Bardsley, Tarkowski, Mee, Taylor; Arfield (Wells 86'), Cork, Hendrick (Vokes 71'), Defour, Gudmundsson; Barnes
Liverpool (4-3-3): Mignolet; Alexander-Arnold, Klavan, Lovren, Gomez; Can, Wijnaldum, Lallana (Milner 87'); Oxlade-Chamberlain (Matip 96'), Solanke, Mane (Firmino 72')