Then with one required off the last ball, Ansari dived to make his ground and seal a two-wicket win.

Victory for Surrey, for whom Kevin Pietersen, Rory Burns and Azhar Mahmood all hit 28, lifted them above Hampshire, who have completed their fixtures, and into second place in the South Group.

However, Hampshire could still finish second in the group on net run rate if Surrey are thrashed at Kent on Friday.

The match was played in front of a capacity crowd at Lord's making it the highest for any domestic Twenty20 fixture in the UK since the format was launched in 2003, surpassing the 26,812 that watched Middlesex and Surrey in 2005.

T20 Blast: South Group

Played

Won

Lost

Tied/NR

NRR

Pts

Top four teams qualify for quarter-finals

Essex

13

10

3

0

+0.485

20

Surrey

13

9

4

0

+0.543

18

Hampshire

14

9

5

0

+0.136

18

Glamorgan

13

5

5

3

-0.169

13

Somerset

13

5

7

1

-0.218

11

Kent

13

5

7

1

-0.336

11

Sussex

13

5

8

0

-0.078

10

Gloucestershire

13

5

6

2

-0.081

10

Middlesex

13

2

10

1

-0.400

5

Surrey captain Gary Wilson:

"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 Oval."

Middlesex captain Eoin 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."

BBC links

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.