Harlequins (22) 36
Tries: Melling, Sharp (3), Howell, Sheriffe, Clubb Goals: Purdham (4)
Bradford (0) 24
Tries: Finnigan, Tadulala, Jeffries, Lynch Goals: Harris (4)
Harlequins survived a stunning comeback from Bradford to end a run of five straight Super League defeats.
Tries from Chris Melling, David Howell and a brace from Will Sharp gave Quins a 22-0 lead at the break.
Scores from Simon Finnigan, Semi Tadulala, Ben Jeffries and Andy Lynch put the Bulls 24-22 ahead.
But Quins dug deep and Ricky Sheriffe, Tony Clubb and Sharp all scored in the dying minutes to leave Bradford's play-off hopes in real jeopardy.
The game might have turned out very differently had an effort from Bradford winger Dave Halley not been ruled out for a forward pass early in the contest.
Quins responded with two tries in three minutes after Danny Ward released Melling for a clear run to the line and Henry Paul and Howell combined to free winger Sharp.
Scott Hill and Purdham then created space for Howell to score.
Shortly afterwards Howell broke clear before passing for Sharp to further extend the home side's lead.
Bradford responded strongly, Harris setting up Finningan and David Solomona slipping a tackle for Tadulala to score.
Jeffries pounced on a kick from Harris and Lynch burrowed over as the Bulls took the lead.
But Quins rallied late on to record their first win since they beat Leeds 28-24 on 14 June.
Harlequins coach Brian McDermott on Will Sharp:
"Will looks erratic and he often looks like he is running through a brick wall.
"He's a bit like the Wild Man of Borneo as he looks as though he's just tearing around. But there's a lot of skill there and he keeps getting better.
"We've been nipped and pipped too often. That's why today meant so much."
Bradford coach Steve McNamara:
"We were as far away from where we want to be as possible.
"We gave ourselves a lot to do in the first half, and then after we got ourselves in a position to win the game, let ourselves down again.
"I'm very disappointed with how we finished the game as we should have been stronger than that."
Harlequins : Melling, Sharp, Howell, Clubb, Sheriffe, Hill, Orr, Haggerty, Randall, Ward, Grayshon, Purdham, Paul.
Replacements: Rinaldi, Temata, Mbu, Heckenberg.
Bradford: Platt, Halley, Sykes, Evans, Tadulala, Jeffries, Harris, Vagana, Newton, Lynch, Solomona, Finnigan, Langley.
Replacements: Cook, Nero, Godwin, Kopczak.
Referee: A Klein.