Stuart Meaker marked his first domestic Twenty20 appearance for two years with a competition-best four for 30 as Surrey all but secured a home tie in the quarter-finals of the NatWest T20 Blast with a thrilling two-wicket last-ball victory against London rivals Middlesex at Lord's.
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.
With left-arm spinner Ravi Patel taking two for 15, Surrey lost their way in the middle overs, but eventually achieved the objective by reaching 138 for eight, with Kevin Pietersen, Rory Burns and Azhar Mahmood all hitting 28.
Middlesex had earlier totalled 137 for eight, falling away in the final part of their innings, but it was so nearly enough as Eoin Morgan's side battled hard to defend their score on a pitch with something in it for both seamers and spinners.
Joe Denly, who was dropped at slip on two, lifted Matt Dunn over mid-off for four and cut Meaker for two successive fours, the second of which Ansari managed to get a hand to.
Denly was eventually bowled for 16, attempting to hit Mahmood over midwicket, but with Morgan pulling Tillakaratne Dilshan to long-on Middlesex were 51 for one at the end of the powerplay.
In the seventh over, Morgan backed away and cut Gareth Batty through extra cover for four, before repeating the stroke for a maximum.
Dilshan, who conceded just 18 runs off his four overs, bowled Dawid Malan, who was on the walk, for 25.
But after a handy third-wicket stand of 42 between Morgan and Ryan Higgins, the Middlesex innings fell away badly, collapsing from 108 for two to 128 for eight.
Meaker took four of those wickets, including bowling Morgan and Higgins in the 15th over.
In reply, Surrey were checked initially by Steven Finn's pace and bounce, with the paceman rewarded when Dilshan, fending at a bouncer, was caught behind.
Jason Roy and Pietersen added 48 in six overs, with the latter clipping Finn through the on-side for a couple of boundaries.
After being struck on the helmet by Harry Podmore, Roy was handed a reprieve, on three, when Higgins, at deep square leg, lost the ball in the setting sun. Roy took full advantage of a free hit by clubbing Podmore over long on for six.
Roy punched two successive fours square, either side of the wicket, off Christian only to dance down the wicket to Patel's third ball to be stumped for 21.
Pietersen reverse-swept Rayner for four before holing out to long-off. With the runs drying up, Gary Wilson was also stumped off Patel.
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.
Burns made 28 off 19 balls before top edging an on-drive high to the keeper off Podmore and a superb catch by wicketkeeper Simpson off Podmore saw the back of Mahmood.
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.
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."