Clegg put his side further ahead with a penalty, but after building that early 8-0 lead the hosts found themselves on the receiving end of a telling Blues riposte.
Wing Thomas, a late replacement for Wales' Leigh Halfpenny, scored at the corner and, after converting, full-back Blair went over himself before adding the extra points.
Quins number eight Easter struck back, but visiting fly-half Sweeney's clever combination with outstanding centre Casey Laulala bewildered the home defence and the Blues number 10 went over untouched.
Blair again converted and four minutes later gave the final pass to Rush following Andy Powell's power surge to crash.
Blues full-back Blair converted and then saw Quins strike back, Care finishing with a flourish and Clegg converting to give the hosts hope at the break.
The hosts' cause was not helped when Easter was sin-binned in the 32nd minute for illegally killing a move following Sweeney's break.
Blair missed two penalty attempts after the interval, but Quins' defensive frailties were again exposed when Sweeney sent Roberts strolling through in the 50th minute and Blair converted.
British and Irish Lion Roberts finished off the Blues performance in style with a powerful surge down the right to bring the visitors their sixth try.
The Blues join fellow Welsh region the Scarlets in the lower-tier competition's knock-out phase while Harlequins are left to contemplate a poor showing in Europe.
Harlequins boss John Kingston: "Some of our attacking play was very good but, for whatever reason, we chose not to defend.
"If you do not front up against good teams such as Blues you will get punished, and we were.
"They were on the front foot, we were on the back foot and we did not make them work hard enough.
"This has been a hard season for a number of reasons, and we are now facing a crossroads of where we go from here in the remainder of our season.
"If we had to get turned over, this was the game for it to happen.
"Physically we were not at the races. If it looked as if we were not up for it.
"Nothing could be further from the truth. We'd lost some games and wanted to turn things around in this game, saw it as a chance to bounce back.
"So I am very disappointed with our performance. Defence is 50% of any game, and ours was not good enough."
Cardiff Blues boss Dai Young: "It's great to reach the quarters, and while we are disappointed not to go further in the Heineken Cup, we've competed in a very tough group so we are not going to beat ourselves up.
"Quins fielded a very strong team, and to score six tries against them is hugely satisfying.
"We were very good in attack, sloppy in defence. The Achilles heel for us all season has been a lack of scoring tries, so this will fire everyone up for the rest of the season.
"The first 10 minutes did not go according to plan and there was some serious head-scratching out there.
"But once we settled down, our rugby did the talking and I'm very pleased with the overall performance.
"If we don't go on and win the Amlin Challenge Cup, then I hope Scarlets do.
"We are bitter rivals when we play each other, but it would be good for Welsh rugby if one of us takes it home."
Harlequins: N Evans; Strettle, Tiesi, Turner-Hall, Lowe; Clegg, Care, Jones, Brooker, Andress, Percival, Stevenson, Robshaw, Skinner, Easter. Replacements: Drauniniu for Tiesi (71), Mordt for Turner-Hall (63), Dickson for Care (63), Croall for Jones (63), Johnston for Andress (68), McMillan for Skinner (68). Not Used: Marler, Guest.
Sin Bin: Easter (32).
Cardiff Blues: Blair; G Thomas, Laulala, Roberts, T James; Sweeney, Rees; Jenkins, G Williams, Filise, Davies, Jones, A Powell, M Williams, Rush. Replacements: Shanklin for Laulala (73), Flanagan for Sweeney (73), Cooper for Rees (65), Hobbs for Jenkins (73), T Thomas for G Williams (65), G Powell for Filise (68), Tito for Jones (65), White for M Williams (73).
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.