Super League leaders Bradford Bulls survived a huge scare at Harlequins to move clear at the top of the table.
The Bulls romped into a 12-0 lead inside the first quarter but Quins matched the leaders for the next 40 minutes - twice taking the lead - only for Steve McNamara's men to show their class at the death.
The Bulls were rewarded for their early dominance in the ninth minute when loose forward Jamie Langley crashed over from 10 yards.
Paul Deacon confidently converted and the lead was doubled nine minutes later. Australian second-rower Glenn Morrison skipped through the Quins static defence to score his fourth try of the season.
Deacon again converted but Quins were back in it when Paul Sykes finished off a free-flowing move on the half hour.
Sykes could not add the extras but two minutes later the hosts had their second try. Substitute Jon Grayshon broke the Bulls defensive line 40 yards out before feeding Rob Purdham to go over to cut the deficit to 12-8 at the break.
Four minutes after the restart Purdham had a second when he got on the end of Mark McLinden's pass to go in at the corner.
Sykes again missed the kick but his side hit the front five minutes later when winger Jon Wells got on the end of Scott Hill's grubber kick and finished in the corner.
But that woke the Bulls from their slumbers and after 54 minutes the outstanding Morrison spotted a gap in the home defence to go in under the posts and put his side back in front.
Sykes then intercepted a pass from Iestyn Harris to restore the lead but Harris made immediate amends for his error to make it 24-22 in the 62nd minute.
The Bulls gave themselves some breathing distance five minutes later when Lesley Vainikolo intercepted a pass before running the length of the field to go in under the posts with Deacon converting his fifth goal.
Bulls full-back Michael Platt sealed the win seven minutes from time when he crossed for the 11th try of a thrilling match.