Blues (10) 23
Dafydd Hewitt sets Cardiff Blues on their way with the opening try
Tries: Hewitt, Shanklin
Cons: Blair 2
Pens: Blair 3
Harlequins (0) 12
Tries: Luscombe, Brown
Cardiff Blues took control of Pool Three with a confident performance over Harlequins, setting up a last-round thriller with Bristol next week.
The Welsh side know that if they win at Bristol, who lost their game at Stade Francais, they will make the quarters.
Tries from Dafydd Hewitt and Tom Shanklin in each half, plus the kicking of Ben Blair saw the Blues home.
Quins also crossed twice, through Hal Luscombe and Mike Brown, but the visitors were always playing catch-up.
The match had survived three pitch inspections because of heavy rain and the early signs were encouraging that the Arms Park turf was firm underfoot.
Most of the early traffic headed towards the Harlequins end, though, as the Blues tried to stamp an early authority on the game.
It seemed they would be rewarded with a try in the fourth minute as Hewitt broke through, only for the centre to be called back for a crossing offence.
Both sides spurned kickable penalties in favour of going for attacking line-outs but the defences held firm.
The Blues remained on top and Gareth Thomas and Shanklin caught the eye with some pleasing clean line breaks.
But with 15 minutes gone the Welsh side had just three points from the boot of Blair - after Quins were caught slowing ball - to show for their dominance.
Chris Malone twice had a chance to level the scores either side of the half-hour mark, but each time the Quins fly-half pushed his kick across the posts.
Finally, the home side found the breakthrough their dominance deserved, Martyn Williams checking the Quins defence before his pop-pass found Hewitt cutting a superb angle.
The centre raced under the posts to give Blair a simple conversion that stretched the Blues' lead to 10-0 at half-time.
Quins started the second period with renewed purpose and put together a period of sustained pressure that at last asked questions of the Blues defence.
Malone's perceptive long pass gave Brown time to build up a head of steam and the full-back showed great strength to break two tackles and send Luscombe over, Malone converting.
The Quins wing will be hoping his name is one of the 28 that new Wales coach Warren Gatland - watching in the stands - will announce in his Six Nations squad on Monday.
That try will not have done Luscombe's chances any harm, although he probably remains one of the outside bets for a call-up.
The Blues were rocked but Blair settled their nerves with his second penalty, then added a third after Quins had De Wet Barry sin-binned for slowing ball one time too many.
No sooner had Quins gone back up to full strength, amid a flurry of replacements, than the Blues struck with a second try.
The home forwards drove forward impressively over the line, but it was Shanklin who emerged from the bottom of the pile with the ball after the centre had sneaked into the maul.
Blair's conversion took the score to 23-7 and the Blues out of reach of the visitors with only eight minutes remaining on the clock.
Brown did add a consolation try after Quins caught the Blues napping with a quick penalty tap, although replacement kicker Adrian Jarvis's conversion went wide.
The Blues will win Pool 3 if they topple hosts Bristol on Sunday week in the final round of pool games.
Defeat at the Memorial Stadium, though, could let French champions Stade Francais through the back door.
Stade's last game is away to already-eliminated Quins and they currently have 13 points, with Bristol on 12 and the Blues on 16.
Blues coach Dai Young:
"It wasn't a perfect performance by us, but it was never going to be.
"What pleased me was that we didn't panic and we managed to close the game down. I was pleased with our control and our mind-set.
"We are happy where we are in the group. We have now got to make sure we can get over one more big hurdle."
Quins director of rugby Dean Richards:
"I thought there was a huge amount of endeavour. There were some very pleasing things.
Our front row played really well and our scrum totally dominated their scrum. "Game control is what we are lacking at the moment - the ability to turn the screw when it matters."
Blues: Ben Blair; Jamie Roberts, Tom Shanklin, Dafydd Hewitt, Gareth Thomas; Nick Macleod, Jason Spice; Gethin Jenkins, Gareth Williams, Tauf'au Filise, Deiniol Jones, Paul Tito, Maama Molitika, Martyn Williams, Xavier Rush (capt).
Replacements: John Yapp, Duane Goodfield for G. Williams (76), Scott Morgan, Mark Lewis, Richie Rees, Rhys Jones, Jamie Robinson for D. Hewitt (77).
Harlequins: Mike Brown; David Strettle, Hal Luscombe, De Wet Barry, Tom Williams; Chris Malone, Steve So'oialo; Ceri Jones, Gary Botha, Mike Ross, James Percival, Nicolas Spanghero, Tom Guest, Paul Volley (capt), Chris Hala'ufia
Replacements: Tani Fuga for Botha (70), Ricky Nebbett, Ollie Kohn for Percival (70), Phil Davies for Hala'ufia (70), Danny Care, Adrian Jarvis for Malone (70), Tosh Masson for Barry (70).
Sin Bin: Barry (58).
Referee: Romain Poite (France).