|Harlequins (14) 23|
|Tries: Merrick, Chisholm Cons: Evans 2 Pens: Evans 2, Botica|
|Northampton (17) 27|
|Tries: Day, Burrell, Foden Cons: Myler 2, Hanrahan Pens: Myler, Hanrahan|
Ben Foden scored a last-gasp try as Northampton beat Harlequins to end their unbeaten home run at The Stoop.
Saints took an early lead through a Stephen Myler penalty before Quins' George Merrick crossed for an easy try.
Christian Day and Luther Burrell touched down for the visitors either side of a Ross Chilsholm score to give Saints a narrow lead at the break.
Nick Evans and Ben Botica penalties put Quins up by three, but Foden crossed with the clock on red to steal the win.
Harlequins, unbeaten at home in all competitions this season, were slow off the mark as Saints fly-half Myler put his side ahead from the kicking tee.
But the home side, playing against the wind, scored with their first real period of possession as Merrick finished off a nice passing move.
Northampton's centre pairing of Harry Mallinder and Burrell caused havoc in the first half which led to an easy try for Day, who scored under the posts before Myler converted.
The running rugby continued as conditions made kicking tricky and Quins full-back Chisholm stormed over, before another cutting run from Mallinder and perfectly-timed pass put in Burrell for his third league try of the season.
Saints began the second half with a three-point lead and an extra man courtesy of Tito Tebaldi's yellow card at the end of the first period, but they gave away two cheap penalties in quick succession and were punished by the boot of Evans.
Northampton flanker Tom Wood spent 10 minutes in the bin as the two teams exchanged a string of penalties to give Quins a 23-20 lead with time up on the clock.
Saints were penalised for holding on and Harlequins simply had to clear the ball to win, but Foden's acrobatics kept the ball in play and he finished off the move with a simple dummy to hand his side victory.
Harlequins director of rugby Conor O'Shea:
"I cannot describe or put into words how I feel right now, I've never seen anything like it on a rugby field.
"Should we have been done and dusted and over the hill? Yes, because of how we played in the match as a whole.
"There are so many things I could go back over, but we talk about what we can control. Well that was nothing short of unbelievable and unforgivable.
"You just had to walk over the dead-ball line and kick it over. We had the ball in our hands, it's just a shame, it takes away so much of the brilliant rugby we played out there."
Northampton head coach Jim Mallinder:
"What's the expression? It's never over until the final whistle and I guess that was never more true than today.
"When we got the penalty and kicked to the corner I thought we had a good chance of scoring from the maul but then you think that's it, especially when they hook the ball and get it to the back you think it's over.
"But somehow the ball didn't go out but great credit to Ben Foden and the rest of the lads out there to react and get that final score."
Harlequins: Chisholm; Yarde, Hopper, Sloan, Walker; Evans (capt), Tebaldi; Lambert, Buchanan, Sinckler, Merrick, Horwill, Luamanu, Wallace, Easter
Replacements: Gray, Evans, Collier, Matthews, Ward, Waters, Botica, Swiel
Northampton: Foden; K Pisi, Burrell, Mallinder, Elliott; Myler, Dickson (capt); Waller, Haywood, Brookes, Craig, Day, Gibson, Wood, Dickinson
Replacements: Marshall, Waller, Denman, Matfield, Harrison, Kessell, Hanrahan, Wilson
For the latest rugby union news follow @bbcrugbyunion on Twitter.