Alex Cuthbert gave Blues a dream start after three minutes with a close range score and the boot of Gareth Davies opened up the lead early on.
Rhys Priestland’s clinical score, after a charge down on Dan Fish’s kick, gave Scarlets a way back just after the half hour as Blues took a 14-8 lead into the break.
A tense and fiery second half saw Robin Copeland and Liam Williams both sent off before the hour as tempers flared.
Ken Owens drove over with less than ten minutes left as the lead was cut to a point, but Blues produced a superb late defensive show to hold out and climb to seventh in the league standings.
Blues made three changes to the side that defeated Edinburgh as Bradley Davies, Dafydd Hewitt and Matthew Rees all came into the starting line-up.
But the new-look line-up came out firing and picked up where they left off in Scotland as the impressive Cory Allen looked to step into space while Cuthbert kicked in behind as Blues looked to play territory in the opening minutes.
Blues duly made a brilliant start as they rumbled up close through a powerful driving maul and Macauley Cook, Rees and Filo Paulo both went close before the forwards drilled inches short, showed patience and Cuthbert popped up off his wing and crashed over.
When play restarted, Cuthbert was crudely taken out in the air by Wales’ team-mate Liam Williams as he took a high hanging cross field kick from Priestland. Referee Ian Davies consulted with the TMO before yellow carding the visiting full back.
Blues looked to use the extra man immediately as Josh Navidi and all-action hooker Rees carried powerfully into contact as the home side continued to play with pace and expansive style in the opening ten minutes.
The first scrum of the game saw Gethin Jenkins get the better of opposite number Samson Lee and up stepped Gareth Davies to extend the lead to 8-0 after nine minutes.
Jonathan Davies looked to give Scarlets go forward, but he knocked on under pressure as Blues kept it tight, while centre Allen showed his all-round game as he hacked ahead and forced Jordan Williams to run the ball dead.
Scrum half Gareth Davies almost picked off a floated pass from Lewis Jones as home fans had hearts in mouth as Blues looked to play wide and fast after Copeland and Navidi punched holes.
Aaron Shingler was then penalised for not rolling away, after Rees again carried prominently, and Davies lined up another penalty kick that split the posts for an 11-0 lead.
The Blues defence forced Jordan Williams into touch as Scarlets continued to feed off scraps while Macauley Cook strode over in the corner after some lightening quick hands, but referee Davies disallowed the score as he went back for a forward pass in the build-up.
Copeland had the home fans on their feet as he stripped the ball on the halfway line and powered down the middle as he fended off tackles.
Scarlets did have the chance to get on the scoreboard just before the half hour mark when Blues were caught offside. Jordan Williams lined up the long range kick but hit the right upright.
The visitors were, though, given a way back into the game from nothing as Fish saw his kick charged down and the ball was gobbled up by Josh Ball who fed the grateful Priestland to race over. Priestland amazingly missed the conversion from in front of the posts.
Davies showed him how to do it off the kicking tee three minutes later as he slotted a much more difficult kick from wide left to extend the lead to 14-5.
Phillips skipped through tackles to put Scarlets into space as they looked for a big finish to the half, but the young winger looked to force the offload and the impetus was lost.
However, Priestland made no mistake as he slotted a penalty on the stroke of half-time as Blues took a slender 14-8 lead into the break.
Blues made a half-time change as Chris Dicomidis replaced Bradley Davies, but it was Scarlets who made a quicker start and looked set to score as only a forward pass in the build-up from Jonathan Davies denied Phillips.
Scarlets were dominating territory and possession at the start of the second half as Blues struggled to get any fluency going in the first ten minutes.
The visitors’ dominance should have been rewarded with points, but Priestland saw his penalty drop sort and wide left.
Cuthbert finally set Blues on the front foot with a break from deep and Ta’fao Filise powered down field with a stunning run before Cook looked to barge past men on the opposite flank but was isolated and penalised for holding on.
Blues played some great running rugby to again go close to the visiting line and won a penalty. Back went play for the TMO and after several minutes the officials sent off Liam Williams, for a second yellow, and Copeland, with a straight red, for an off the ball incident.
Wingers Cuthbert and Czekaj combined to send Blues into space again before Allen burst into free air and Scott Andrews popped up on his shoulder as the game opened up dramatically.
A big home scrum on 61 minutes gave Gareth Davies the chance to extend the lead but he uncharacteristically pulled his kick wide left of the posts.
Brilliant turnover work by Gethin Jenkins on the floor resulted in a penalty that Fish nudged into the corner. But after several drives were repelled the Scarlets turned over ball and only a last ditch tackle from Gareth Davies halted a flying Jordan Williams down the touchline.
Ken Owens superb break and hand-off saw the hooker make 30-metres and Scarlets quickly recycled and went for the jugular with a penalty kicked to the corner. The lineout drive worked as Owens finished the move he started as he dotted down.
A crucial penalty claimed by Jenkins for more superb work at the breakdown gave Davies a chance to have a shot at the posts from 40-metres out. The fly half made no mistake and split the posts for a 17-13 lead with four minutes left.
A tense and dramatic final few minutes saw Scarlets camp in the Blues half, but the hosts were not to be denied and a huge roar sounded around the Millennium as they secured a penalty in the third minute of injury time to claim the win.
Timeline:
03m Cuthbert t 5-0
09m Davies p 8-0
16m Davies p 11-0
32m Priestland t 11-5
35m Davies p 14-5
40m Priestland p 14-8
72m Owens t 14-13
76m Davies p 17-13
Cardiff Blues: 15 Dan Fish, 14 Alex Cuthbert, 13 Cory Allen, 12 Dafydd Hewitt, 11 Chris Czekaj (Robinson 71), 10 Gareth Davies, 9 Lewis Jones (Williams 59); 1 Gethin Jenkins, 2 Matthew Rees (Williams 62), 3 Taufa’ao Filise (Andrews 54), 4 Bradley Davies (Dicomidis 40), 5 Filo Paulo, 6 Macauley Cook, 7 Josh Navidi, 8 Robin Copeland
Replacements: 16 Rhys Williams, 17 Thomas Davies, 18 Scott Andrews, 19 Chris Dicomids, 20 Ellis Jenkins, 21 Lloyd Williams, 22 Simon Humberstone, 23 Harry Robinson