Aston Villa moved level with Premier League leaders Liverpool as a late Douglas Luiz penalty secured victory against 10-man Burnley.
The Brazil midfielder converted from the penalty spot in the 89th minute after Jhon Duran was fouled by former Villa player Aaron Ramsey.
Burnley had twice come from behind in the game, with Lyle Foster scoring their second equaliser despite the visitors being reduced to 10 men following Sander Berge's second yellow card.
Moussa Diaby put Villa ahead again on 42 minutes after Leon Bailey's opener for Villa had been cancelled out by an almost immediate equaliser by Zeki Amdouni.
The victory moves Villa onto 42 points and behind Liverpool only on goal difference, with the Reds set to host Newcastle United on New Year's Day.
Despite the battling performance Vincent Kompany's Burnley stay five points from safety.
Reaction from Saturday's Premier League gamesWhat did you make of Aston Villa's display? Send us your views hereHow did you rate Burnley's performance? Have your say hereVilla set club record with late win
Villa opened the scoring on 29 minutes when Bailey picked up Ollie Watkins' pass across the box, cut in from the right and fired into the roof of the net via a deflection.
Burnley equalised almost immediately when a high free-kick from the left was headed back across goal by Dara O'Shea, allowing Amdouni to acrobatically volley in from close range.
Villa went back in front with Watkins - narrowly judged onside by the video assistant referee - again the provider as the England striker pulled the ball back for Diaby to finish.
Burnley's hopes of another comeback were dented in the second half when midfielder Berge received a second booking for pulling Luiz's shirt.
Leon Bailey fired Aston Villa in front, only for the hosts to be pegged back two minutes laterBut after Villa missed several chances, Foster streaked clear of their defence and beat Emiliano Martinez at the near post.
It was Foster's first goal since October, following a two-month break to look after his mental health, and it looked to have earned Burnley a point from a losing position for the first time in the Premier League this season.
But Ramsey - a Villa academy product who joined Burnley in the summer, and whose brother Jacob started for the hosts - clipped Duran in the area to allow Luiz the opportunity to win the game from the spot.
The midfielder's penalty twice struck the bar - hitting the woodwork then bouncing up from the grass and off it again before crossing the line - but it was enough to earn Villa a 32nd victory in league and cup matches this calendar year, surpassing the previous club record set in 1977.
Missed chances nearly costly for hosts
Having passed up the opportunity to top the Premier League at Christmas for the first time in 25 years, Villa's surprise Premier League challenge was in danger of unwrapping over the festive period as they laboured against Burnley.
Their 3-2 defeat to Manchester United on Boxing Day after being two goals ahead followed a draw against Sheffield United, and Villa were in danger of dropping more points at home to a side in the relegation zone.
As they did against Sheffield United, Villa often looked weighed down by the pressure that comes from a lofty position that is perhaps unexpected.
Diaby, despite his goal, was particularly guilty of missing several good chances while Burnley keeper James Trafford once again made a string of fine saves.
They had some luck too, with Diego Carlos cleared by VAR despite appearing to handle the ball under pressure from Clarets striker Foster.
But as they did with a 97th-minute equaliser against Sheffield United, Unai Emery's side fought to the close to earn a result that was better than their performance.
Watkins was central to their efforts, despite the England striker failing to match Andy Gray's record of most Villa goals in a calendar year - he netted 21 times in 2023, two fewer than the Scotland forward in 1976.
While he was unable to find the net, the former Brentford striker's endless running and selfless play was invaluable and he provided assists for Villa's opening two goals.
Line-ups
Aston Villa
Formation 4-4-1-1
1E MartínezBooked at 90mins4KonsaBooked at 18mins3Diego Carlos17LengletSubstituted forP Torresat 62'minutes15Moreno31BaileySubstituted forDendonckerat 90+3'minutes7McGinnBooked at 90mins6Douglas Luiz41J RamseyBooked at 88mins19DiabySubstituted forDuránat 82'minutes11WatkinsSubstitutes
14P Torres16Chambers22Zaniolo24Durán32Dendoncker42Marschall47Iroegbunam78ProctorBurnley
Formation 4-4-2
1Trafford22da Silva2O'Shea5BeyerSubstituted forDelcroixat 17'minutes3TaylorBooked at 23mins7GudmundssonSubstituted forRobertsat 74'minutes16BergeBooked at 56mins8Brownhill47OdobertSubstituted forTrésorat 74'minutes17Foster25AmdouniSubstituted forA Ramseyat 59'minutesSubstitutes
9Rodríguez14Roberts15Redmond21A Ramsey31Trésor34Bruun Larsen44Delcroix45Obafemi49MuricLive Text
Match ends, Aston Villa 3, Burnley 2.
Second Half ends, Aston Villa 3, Burnley 2.
Offside, Burnley. Connor Roberts is caught offside.
John McGinn (Aston Villa) is shown the yellow card for a bad foul.
Foul by John McGinn (Aston Villa).
Josh Brownhill (Burnley) wins a free kick in the defensive half.
Offside, Aston Villa. Jhon Durán is caught offside.
Emiliano Martínez (Aston Villa) is shown the yellow card.
Foul by Jhon Durán (Aston Villa).
Charlie Taylor (Burnley) wins a free kick in the defensive half.
Substitution, Aston Villa. Leander Dendoncker replaces Leon Bailey.
Hand ball by Lyle Foster (Burnley).
Goal! Aston Villa 3, Burnley 2. Douglas Luiz (Aston Villa) converts the penalty with a right footed shot to the top right corner.
Jacob Ramsey (Aston Villa) is shown the yellow card.
Penalty Aston Villa. Jhon Durán draws a foul in the penalty area.
Penalty conceded by Aaron Ramsey (Burnley) after a foul in the penalty area.
Offside, Burnley. Connor Roberts is caught offside.
Delay over. They are ready to continue.
Delay in match because of an injury John McGinn (Aston Villa).
Delay in match because of an injury Josh Brownhill (Burnley).
How to play
Rate players out of 10 throughout or after the game. The rater will close 30 minutes after the final whistle.
Rating range key1 = Give it up10 = Pure perfection
Aston Villa
Squad number1Player nameE Martínez
Squad number4Player nameKonsa
Squad number3Player nameDiego Carlos
Squad number17Player nameLenglet
Squad number15Player nameÁlex Moreno
Squad number31Player nameBailey
Squad number7Player nameMcGinn
Squad number6Player nameDouglas Luiz
Squad number41Player nameJ Ramsey
Squad number19Player nameDiaby
Squad number11Player nameWatkins
Squad number14Player nameP Torres
Squad number24Player nameDurán
Squad number32Player nameDendoncker
Burnley
Squad number1Player nameTrafford
Squad number22Player nameVitinho
Squad number2Player nameO'Shea
Squad number5Player nameBeyer
Squad number3Player nameTaylor
Squad number7Player nameGudmundsson
Squad number16Player nameBerge
Squad number8Player nameBrownhill
Squad number47Player nameOdobert
Squad number17Player nameFoster
Squad number25Player nameAmdouni
Squad number14Player nameRoberts
Squad number21Player nameA Ramsey
Squad number31Player nameTrésor
Squad number44Player nameDelcroix