Champions Northampton moved 13 points clear at the top of the Aviva Premiership with a victory which surely ends Harlequins' hopes of reaching the top four.
Tries from Samu Manoa, James Wilson and Tom Wood secured what was in the end a comfortable 17-13 success, despite Harlequins disrupting the home side's set-piece.
The visitors had opportunities but squandered them in the face of a determined Saints defence, though Marland Yarde ran in under the posts with the last play of the game to give ninth-placed Quins a point.
The first half descended into a mistake-ridden affair at times - and surprisingly it was Harlequins who won the first penalty at a scrum, with tighthead Kyle Sinkler getting plenty of pats on the head from his team-mates.
Former All Black Nick Evans calmly gave Harlequins the lead after 27 minutes - but Northampton did not wait long to hit back.
The hosts decided to kick their penalty into the corner after Sinkler had spilled the ball in his 22 as the visitors tried to run back the restart. Although Quins repelled the initial drive, the Saints pack regrouped for Manoa to touch down - and Stephen Myler converted to make it 7-3 after 32 minutes.
Quins responded with another Evans penalty four minutes later and the home side looked like they would repeat their earlier response when Myler kicked a penalty to the corner, but with Mike Haywood off with a cut to the head, replacement hooker Matti Williams missed his jumper at the line-out.
Five minutes into the second half the visitors looked to be going nowhere until Luke Wallace bounced his way through.
There looked to be a knock-on before Yarde headed for the corner and he looked certain to score but the TMO ruled Northampton had just bundled him into touch.
Quins had plenty of possession to start the second half, but the Saints defence held firm and when the home side won a turnover on the visitors' 10-metre line centre Tom Stephenson looked set for a try.
Harlequins had to stop Northampton illegally, according to referee Tim Wigglesworth, and from the line-out Saints moved the ball wide after a strong run from substitute Wood for Wilson to score. Myler hit the post with the conversion to leave the home side 12-6 ahead after 55 minutes.
Two minutes later Sinkler was yellow-carded for a dangerous tackle and Northampton took advantage.
A promising break by Yarde was turned over and when the home side won a penalty, they once again kicked to the corner for Wood, on his return from injury and in his 100th appearance for Northampton, to be driven over.
Myler missed the conversion, but Northampton were now 17-6 ahead with 12 minutes to play.
To compound Quins' woes Evans then went off injured - and although t he visitors thought they had got back in the game with a Charlie Walker try, the TMO ruled the final pass was forward.
However, at the end Yarde sprinted through for a try for the visitors, which was converted by Ben Botica.