Middlesex tore through Surrey's last six wickets for just 36 runs to clinch a thrilling three-run victory in their LV= County Championship Division One London derby at Lord's.
Resuming on the final morning at 96-4, Surrey needed just a further 45 runs to secure their first victory at the home of cricket since 1997, but the visitors were simply unable to cope with the movement generated by Middlesex seamers Tim Murtagh, Gareth Berg and Toby Roland-Jones.
Surrey's collapse began with the 13th ball of the day when Tom Maynard heaved across the line against Berg to go leg before for 15 having added only three to his overnight score.
Murtagh then delivered two quick blows as he removed both Chris Jordan and Gareth Batty for ducks, the former bowled off an inside edge and the latter trapped in front.
Skipper Rory Hamilton-Brown - who had resumed unbeaten on 51 - continued to be the mainstay of the Surrey innings and looked to be guiding his side to victory as he found a solid ally in Jon Lewis (21 not out).
But when Hamilton-Brown was snared by Roland-Jones after edging behind for 63 from 73 balls, Middlesex scented blood with Surrey needing a further 15 with two wickets remaining.
Tim Linley (two) was next to depart after guiding a Roland-Jones delivery to Dawid Malan at slip meaning that Lewis and last man Jade Dernbach needed to knock off 11 runs for victory.
Dernbach did produce one boundary but, with just four more required, Lewis' gamble of giving him the strike again backfired when the number 11 miscued an attempted off Murtagh high to short cover where Sam Robson ran in to claim the catch and send Middlesex into ecstasy.
Surrey overcame an early wobble in their run chase to leave themselves needing just a further 45 runs with six wickets in hand to beat Middlesex at Lord's.
Skipper Rory-Hamilton Brown hit an unbeaten 51 from just 55 balls to help the visitors recover from 22-3 in pursuit of a target of 141. They reached stumps on day three on 96-4, with Tom Maynard not out alongside his captain on 12.
They had been left to chase such a small score thanks to the efforts of their bowlers, with experienced seamer Jon Lewis leading the way.
The former Gloucestershire bowler claimed 5-41 to bowl out Middlesex for 106 in their second innings, Stewart Robson top-scoring with 43.
Zander de Bruyn and Jade Dernbach weighed in with two wickets apiece as Surrey seized control of a contest that had been firmly in the balance at the start of play.
They had begun the morning session on 161-5 and moved on to 222 before they were bowled out. Middlesex held a 34-run advantage at that stage, but their second-innings collapse means they now look set to suffer a second successive defeat at the start of the summer.
Surrey failed to capitalise on a good start with the bat at Lord's, finishing day two on 161-5 in reply to Middlesex's first-innings total of 256.
The visitors looked to be on course to surpass their opponents when openers Jacques Rudolph and Steve Davies put on 85 for the first wicket.
However once Rudolph went for 45, stumped off the bowling of spinner Ollie Rayner, Surrey lost their way. Davies was the second wicket to fall with the score on 117, Corey Colleymore removing him for a well-made 62.
Mark Ramprakash and Zander de Bruyn both contributed 17 before perishing in successive overs, while Neil Dexter claimed his second wicket when Tom Maynard was caught by Gareth Berg for just three.
Rory Hamilton-Brown was eight not out at the close alongside Chris Jordan, who had a single to his name, as Surrey still trailed their London rivals by 95 runs.
Middlesex had begun the day with their last-wicket pair at the crease, Dawid Malan adding 26 runs to his overnight score before he was last man out for 88. It meant the home side's last three wickets had added 127 runs.
Dawid Malan made an unbeaten 62 to help Middlesex fight back from 129-7 to 229-9 by the end of the opening day agaist Surrey at Lord's.
The left-handed batsman hit five boundaries during his gritty 172-ball knock, though he needed some help from the tail after Middlesex had lost five wickets for 56 runs in the afternoon session.
Surrey's seamers backed up the decision of skipper Rory-Hamilton Brown by seeing off the first five wickets inside 32 overs, including Jade Dernbach (3-33) taking two in successive balls.
Sam Robson had made 40 for the hosts but perished immediately after a rain break, while Dernbach dismissed Chris Rogers for 20 before Neil Dexter and John Simpson fell to the England international in the same over.
However, Malan proved a tough obstacle to remove. The 24-year-old shared a 53-run stand with Tim Murtagh, who missed a slog sweep to go lbw to Gareth Batty after battling hard for his 31 runs.
Toby Roland-Jones (16) added a further 41 for the ninth wicket before he nudged to slip to become Surrey's final victim of a see-saw day.