Alex Cuthbert's try four minutes from time, converted by Rhys Patchell, gave Cardiff Blues a 29-27 win over Scarlets in a thrilling derby at the Arms Park.
The visitors appeared on course to overcome the loss of three players to the sin bin, with Lewis Rawlins, Steffan Evans and Emyr Phillips all receiving yellow cards, but Cuthbert levelled matters before Patchell added the extras to seal a Blues victory.
Cardiff had extra reason for cheer after four tries through Cory Allen, Dan Fish, Kristian Dacey and Cuthbert guaranteed them a bonus point, with Patchell converting three of the scores and kicking a penalty.
The courageous and injury-ravaged Scarlets scored three tries from Ken Owens, DTH van der Merwe and Gareth Davies, while Aled Thomas converted all three and kicked two penalties.
Scarlets were without international forwards John Barclay and Jake Ball, who were both injured in last week's game against Ospreys, but they received a boost with the return of scrum-half Gareth Davies.
For Blues, Allen made his first league appearance of the season with Patchell switching to outside half to accommodate Fish at full-back.
Cardiff began brightly and took a second minute lead with a Patchell penalty after Gethin Jenkins was high tackled by opposing prop Rob Evans, but two bad mistakes from the home side gifted Scarlets the lead.
A poor pass from Patchell was collected by Davies, who raced 60 metres to secure his side a line-out in the hosts' 22. It was Cardiff's throw but Dacey overthrew straight to Owens, who crashed over.
Worse was to follow for within five minutes, the Blues had given away another seven points. This time a telegraphed pass from Tom James was intercepted by Van der Merwe, who ran over 60 metres to score under the posts with Thomas converting for a 14-3 lead.
The frenetic opening continued with Cardiff scoring their opening try when Rey Lee-Lo made the break for Allen to score. Patchell converted before Thomas kicked two penalties for the visitors.
Just before the interval, Scarlets lock Rawlins was yellow carded for dragging down a driving maul but the visitors went in at the break 20-10 ahead.
Rawlins remained absent for the first nine minutes of the second half and it looked as though Blues were not going to make their man advantage count, but just before the lock's return they scored a splendid try.
Manoa Vosawai put the opposition defence on the back foot and the ball was spread wide to send James tearing down the left flank before the wing passed inside to Fish, who scored.
Cardiff were becoming increasingly dominant and a try looked a probability until Scarlets wing Evans deliberately knocked on to earn a yellow card.
Minutes later, Phillips joined his team mate in the bin for collapsing a driving line-out.
Down to 13 men was too much of a disadvantage for Scarlets and they conceded a third try when Dacey drove over for Patchell to convert and Blues were 22-20 ahead going into the final quarter.
Amazingly Scarlets, still with 13 men, rallied to regain the lead as Davies forced his way past an attempted tackle from Sam Hobbs and over the line for the try which Thomas converted.
The visitors were restored to a full complement of players but Cardiff had the final say when Cuthbert forced his way over from close range, with Patchell's conversion breaking Scarlets' hearts.