A T20 record crowd at Lord’s were treated to a grandstand finish as Surrey scrambled a single off the last ball to beat Middlesex by two-wickets.
Stuart Meaker marked his first domestic Twenty20 appearance for two years with a competition-best 4-30 as Surrey all but secured a home tie in the quarter-finals of the NatWest T20 Blast.
In front of a crowd of 28,500 - the highest attendance for any domestic T20 fixture in the United Kingdom - Surrey's Zafar Ansari scrambled a single to cover off the last ball to take the visitors home.
Middlesex had only mustered 137-8 in their 20 overs, skipper Eoin Morgan hitting 43 but seeing his team falter in the latter stages as Meaker collected four wickets.
It was almost enough though as Surrey started to feel the pressure near the death, but Ansari rescued the visitors with his single off the last ball of the night putting them on 138-8 and securing a thrilling victory.
Kevin Pietersen, Rory Burns and Azhar Mahmood all hit 28 for the visitors, who were checked initially by Steven Finn's pace and bounce, with the paceman rewarded when Dilshan, fending at a bouncer, was caught behind for a duck.
Jason Roy and Pietersen added 48 in six overs, before Roy tried to dance down the wicket to Patel's third ball only to be stumped for 21, while Pietersen reverse-swept Rayner for four before holing out to long-off.
Rory Burns slog swept Dexter for a six and followed it up with a cut four. With Mahmood clipping to fine-leg and top edging a pull off Christian, Surrey were left needing 32 off the last five overs.
With Ansari and Peterson finding the gaps, even against Finn, Surrey only required six to win off eight balls when Peterson lobbed a catch to mid-off.
When Batty was caught a deep midwicket off Christian that became five needed off as many balls, but Ansari and Meaker held their nerve.
Gary Wilson, the Surrey captain, said: "It was great to get over the line there at the end, but it was very close and full marks to Middlesex for making us fight all the way.
"It is important to get a home quarter-final tie, which we virtually have done now, because we think we know how to win matches at the Kia Oval."
Middlesex captain Morgan said: "We would have liked about 20 more runs and we should have got more. We also dropped a couple of catches early on, which didn't help us.
"It's been a disappointing campaign but we just haven't played well enough at certain times of most games.
"Steven Finn, though, bowled with international-class pace and bounce tonight and Harry Podmore has been one of the plus points for us from the Twenty20 group stage."