Ulster (16) 21
Tries: Cave, Best Pens: Humphreys 3 Cons: Humphreys
Harlequins (0) 10
Try: Penalty Con: Evans Pen: Evans
Ulster players congratulate Darren Cave after the opening try
Rory Best's late try dented Harlequins' Heineken Cup hopes as Ulster secured victory in awful weather at Ravenhill.
Darren Cave's second-minute try and the kicking of Ian Humphreys gave the hosts a deserved 16-0 interval lead.
A converted penalty try and penalty from Nick Evans put Quins back in touch before Evans was replaced by Chris Malone, which proved a costly decision.
He missed a penalty before Best charged down his clearance to score, leaving Quins to sweat over qualification.
Victory at Ravenhill would have secured a quarter-final place, but they will now almost certainly need to win their final home game next Saturday against the Scarlets, who host fellow pool contenders Stade Francais on Sunday.
Right from the very start, things went against Quins.
They were forced to make a late change when Charlie Amesbury replaced Ugo Monye in the starting XV, and his lack of preparation showed when his indecision left a huge gap in the defensive line, allowing Cave to score Ulster's opening try in just the second minute.
Humphreys added the conversion, and when Nick Easter was penalised for off-side and the penalty moved forward 10 metres for dissent, he added three more points to stretch the lead to 10-0.
Easter in particular seemed rattled by Quins' poor start and was in the thick of things as tempers frayed, with Ulster managing to turn over possession with alarming ease.
Just to underline the point, yet another turnover saw Simon Danielli in a foot race with Tom Williams, and it would surely have resulted in a second try if only the Ulster player's kick ahead had not been too strong.
Humphreys took advantage of the blustery conditions to put over two more penalties and Danny Care's sin-binning just before the interval summed up a miserable opening 40 minutes for the visitors.
Evans's penalty straight after the restart, when Isaac Boss was caught off-side from a scrum, got things off to an ideal start for the visitors.
The return of Care produced immediate benefits, with Boss doing well to hold him up on the line, and the ensuing pressure eventually resulted in a penalty try.
The wind at Harlequins' backs was so strong that spectators were forced to evacuate one of the temporary stands on safety grounds and with conditions getting ever worse, Ulster's defence became increasingly desperate.
With eight minutes to go, Harlequins had a very kickable penalty chance which would have closed the gap to three points, but mysteriously Evans was taken off and replaced by Malone.
His first duty was to take the kick at goal, which he missed, and he then compounded that error by having his kick charged down to set up Best's try, and then putting the restart kick straight out of play.
The result means Harlequins will have to wait another week, when they face the Scarlets at the Twickenham Stoop, to try and secure a place in the last eight.
Ulster coach Matt Williams:
"We adapted well to the conditions and showed a lot of courage. At half-time we spoke about defending the lead in the second half and needed to attack the lead.
"We had to monopolise the ball and when they had it they just couldn't get near us.
"It was all credit to our bench as both Paul Steinmetz and Matt McCullough had great impacts."
Harlequins coach Dean Richards:
"It was difficult in those conditions but the timing of our substitution of Nick Evans annoyed me. I was furious with the fourth official who pushed the substitution through.
"The idea was that Evans took the kick but the referee insisted on putting Chris Malone on and he missed it."
"I thought we gave away far too many silly penalties in the first half, but, look, we're still in Europe with a home game against Llanelli."
Ulster: Schifcofske, Trimble, Cave, Wallace, Danielli, Humphreys, Boss, Court, Best, J. Fitzpatrick, O'Donoghue, Caldwell, Ferris, Dawson, Henry.
Replacements: Cunningham for Wallace (41), Steinmetz for Humphreys (58), Brady for Court (73), Young for J. Fitzpatrick (61), Pollock for Dawson (61), McCullough for Henry (41). Not Used: Marshall.
Harlequins: Brown, T. Williams, Tiesi, Turner-Hall, Amesbury, N. Evans, Care, Jones, Brooker, Ross, Percival, Robson, Robshaw, Skinner, Easter.
Replacements: Taione for Tiesi (52), Malone for N. Evans (72). Not Used: Croall, Lambert, J. Evans, Gomarsall, Guest.
Sin Bin: Care (35).
Ref: Romain Poite (France).