Blues (27) 37
Tries: Halfpenny 2, G Thomas, N Robinson Cons: Blair 4 Pens: Blair 3
Gloucester (17) 24
Tries: Morgan, Balshaw 2 Cons: Barkley 3 Pen: Barkley
Nicky Robinson scores for the Blues against Gloucester
Cardiff Blues claimed a bonus-point Heineken Cup win against Gloucester at the Millennium Stadium in arguably the tournament's best game this season.
Teenage Blues wing Leigh Halfpenny claimed a stunning first-half brace while Gareth Thomas and fly-half Nicky Robinson also touched down.
Gloucester struck back with two tries from full-back Iain Balshaw and an Olly Morgan score in the Pool Six clash.
Rival kickers Ben Blair and Olly Barkley kicked all their shots at goal.
The Blues drew first blood in stylish fashion after a deft one-handed pass from number eight Andy Powell sent Gareth Thomas on a short run down the right.
When the ball came back, Jamie Robinson snapped up brother Nicky's bouncing pass to give Ben Blair the time and space to set up Halfpenny's chance.
The 19-year-old appeared to stumble and Olly Morgan should have thwarted the threat, but Halfpenny burst through the Gloucester full-back's attempted tackle to crash over.
Blair converted and added a penalty to the third-minute try to give the home side an early cushion.
Olly Barkley struck back after Ryan Lamb's high kick and Morgan's follow-up piled on the pressure and forced the Blues into giving away a penalty.
Blair re-established the Blues' 10-point lead after Andy Powell made inroads down the left and Gloucester earned referee Alain Roland's wrath.
The visitors hit back with a superb try. Skipper Mike Tindall made the initial thrust from a scrum-five and Barkley's long pass allowed Iain Balshaw to send Morgan over. Barkley converted.
Gloucester continued to pile on the pressure with Tindall, Cooper and Luke Narraway all going close.
But after Welshman Cooper knocked on a metre short, the visiting pack blasted the Blues off their own put-in and Narraway sent Balshaw over unopposed at the corner for Barkley to convert.
The visitors suffered a big blow after 35 minutes when Lamb limped off, forcing a reshuffle in which Lesley Vainikolo came on and Barkley switched to fly-half and James Simpson-Daniel to centre in the reshuffle.
Gareth Thomas celebrates his first-half try
Things got worse for Dean Ryan's side as poor handling in a promising attack gifted Halfpenny possession and the wing raced 50 metres to score with Blair converting.
The misery did not stop there for Gloucester. From the restart, Blair sidestepped through and Jamie Robinson gave Gareth Thomas the scoring pass for the full-back to convert and give the Blues a 27-17 half-time lead.
The visitors struck first after the break as Tindall's half-break set Balshaw free and Barkley converted, but they saw full-back Morgan limp off in the 44th minute.
Gloucester's scrum had been dominant all game, but in the 63rd minute the Blues turned the tables and from close range Powell powered forward and Nicky Robinson followed up to break Barkley's tackle and score under the posts for their bonus-point try. Blair converted.
Hooker Olivier Azam was sin-binned for handling on the floor in the 71st minute and Blair kicked the penalty to rub salt in Gloucester's wounds, while Narraway became their third injury casualty late on.
Gloucester boss Dean Ryan:
"It will be a big task now to reach the quarter-finals. This has put us on the back foot, and we will have to do something special at Kingsholm.
"I am disappointed we didn't win the game. I thought we had a lot of control, and I thought we looked very threatening.
"But the injuries were very disruptive, especially losing Ryan (Lamb) and Olly (Morgan) either side of half-time.
"I think it meant about five players changing positions, and we never looked the same back-line after the injuries.
"We are two games into the tournament, and Cardiff have still got to come to Kingsholm and play Biarritz back-to-back in December."
Cardiff Blues: Blair; Halfpenny, J Robinson, Shanklin, G Thomas; N Robinson, Spice; Jenkins, R Thomas, G Powell, Jones, Tito (capt), Molitika, M Williams, A Powell.
Replacements: Roberts for Shanklin (53), Rees for Spice (67), Morgan for Jenkins (76), G Williams for R Thomas (57), Filise for G Powell (53), Sowden-Taylor for M Williams (74), Sweeney for J Roberts (78).
Gloucester: Morgan, Balshaw, Tindall (capt), Barkley, Simpson-Daniel, Lamb, Cooper, Dickinson, Azam, Nieto, Bortolami, Brown, Buxton, Strokosch, Narraway.
Replacements: Walker for Morgan (44), Vainikolo for Lamb (36), R Lawson for Cooper (72), Hazell for Buxton (53), Eustace for Narraway (78), S Lawson for Hazell (72).
Not Used: Forster.
Referee: Alain Rolland (Ireland)