Middlesex 187 (Buck 4-51) and 374 (Holden 94, Harris 79*, Robson 72, Kleinveldt 4-69) beat Northamptonshire 346 (Vasconcelos 140, Harris 7-83) and 184 (Vasconcelos 52, Murtagh 5-38) by 31 runs
Tim Murtagh took his second five-wicket haul of the season to bowl Middlesex to an extraordinary win at Wantage Road to keep alive their hopes of promotion from Division Two of the Specsavers County Championship.
Defending 216 after Middlesex had followed-on, Murtagh and 19-year-old debutant Ethan Bamber shared eight wickets as Northamptonshire were bowled out for 187 to lose by 31 runs.
It is the first time in their history that Northants have lost after enforcing the follow-on and the first time since 1924 - and fifth instance overall - that Middlesex have won having been asked to follow-on.
"It's incredible the way we fought back, especially following-on. We were pretty ordinary the first couple of days and to come back and win is just an unbelievable effort," Sam Robson, the Middlesex vice-captain, said. "Ethan was awesome. You're always nervous in your first game and there was a lot of pressure today so for him to bowl the way he did was an incredible effort.
"Obviously Murts we know what he can do but Max and Harry yesterday were so good too."
Northants took just three balls of the morning to bowl Middlesex out for 374 - a remarkable fightback having been 166 for 6 on the third afternoon - and set about their target comfortably, reaching 94 for the loss of Saif Zaib just before lunch. But Luke Procter, who had gone calmly to 35 in a stand of 75 for the second wicket with Ricardo Vasconcelos, drove lazily at Bamber to edge behind and it began an incredible slide.
After lunch, Vasconcelos, having passed fifty for the second time in the match in 73 balls with six fours, tried to force Murtagh off the back foot and edged to second slip. Alex Wakely was then lbw for 6 offering no stroke. Steven Crook never looked comfortable and it was no surprise when he too was lbw for 5, also to Murtagh, before Rory Kleinveldt played all around a Bamber delivery and was also given out leg before.
It was a collapse of 6 for 36 in 14.3 overs and saw Middlesex suddenly favourites to pull off an amazing comeback. Richard Levi made 18 to offer Northants some hope before he was strangled down the leg side trying to flick James Fuller.
Nathan Buck and Brett Hutton at least steered Northants through to tea and as they resumed needing 43 to win with two wickets remaining, the home side were still alive. But Buck drove at Murtagh and popped a catch up to extra-cover and Hutton was trapped lbw by one that slid back in from Murtagh to end the game and complete figures of 5 for 38.
Middlesex danced around knowing they had got themselves out of a massive hole having been outplayed for two-and-a-half days. They remain in the promotion race in Division Two and now play Sussex, who they trail by 39 points, at Lord's next week. With Kent also to play in their remaining five games, the 2016 County Champions could yet bounce back to Division One at the first attempt.
For Northamptonshire it was a sickening defeat - their sixth of the season - having had the game in the palm of their hands. They now travel to Durham trying to salvage something from a terrible year.