England one-day captain Eoin Morgan scored 83 not out off 29 balls to help Middlesex to a record T20 Blast run-chase and seal a quarter-final spot.
Somerset set Middlesex a target of 227 to win at Taunton, with Tom Abell finishing 101 not out for the hosts.
Coming in during the ninth over with his side 111-3, Morgan’s superb knock helped Middlesex to victory with three overs to spare.
Middlesex’s successful chase was also the fourth-highest in T20 history.
Meanwhile, Essex Eagles beat Kent Spitfires by 10 runs to secure the final place in the last eight as the group stage reached its conclusion on Friday.
Five teams had gone into the final round of South Group fixtures with hopes of reaching the quarter-finals.
- Wednesday, 4 September: Lancashire Lightning v Essex Eagles
- Thursday, 5 September: Notts Outlaws v Middlesex
- Friday, 6 September: Sussex Sharks v Worcestershire Rapids
- Saturday, 7 September: Gloucestershire v Derbyshire Falcons
Lancashire’s quarter-final will be held at Emirates Riverside, with Emirates Old Trafford hosting the fourth Ashes Test between England and Australia from Wednesday.
Morgan tees off
Despite losing Babar Azam for a duck in the first over, Somerset would have been confident of making the quarter-finals after posting 226-5 from their 20 overs.
Tom Banton’s 62 got the hosts off to a good start, and Abell hit 13 fours and three sixes as he scored his maiden T20 century.
But Dawid Malan and Paul Stirling helped Middlesex to 94-2 by the end of the powerplay to get Middlesex ahead of the required run-rate.
Sharp fielding from Roelof van der Merwe saw Mohammad Hafeez run out and Max Waller took a brilliant catch to dismiss danger man AB de Villiers.
But Morgan crashed five fours and eight sixes to lead Middlesex to victory with plenty of breathing space.
Their run-chase surpasses the 226 Sussex scored to beat Essex at Chelmsford in July 2014.
“Somerset played extremely well, especially not knowing what a good score is,” Morgan told BBC Radio London.
“Going into the second half of the innings, we knew we’d have to be positive and play extremely well, but the way the guys started was outstanding.
“With Dawid Malan and Paul Stirling at the top of order it allows us to go harder earlier because we have strength in depth throughout the batting line-up.”
Eagles take final spot
Essex had started the evening in seventh place in the group table, knowing they had to beat Kent and hope for a Hampshire defeat to qualify.
Cameron Delport top-scored for the Eagles with 64, while an unbeaten 47 from Ravi Bopara helped them to 189-6.
Kent got off to a good start in their chase and were 102-1 in the 11th over but, after Zak Crawley went for 89, the Spitfires lost their final six wickets for just 17 runs.
Essex leapfrogged Hampshire, who lost by 28 runs at Glamorgan as the Cardiff-based side recorded their first win of the campaign.
Chasing 217 for victory, James Vince made a rapid 43 and Sam Northeast top-scored with 60 but three wickets from Roman Walker and two from Marchant de Lange allowed the hosts to end a miserable campaign on a high.
As you were in the North
In the North Group qualification was settled heading into the final round of fixtures.
Notts Outlaws secured a home quarter-final despite losing by 47 runs at home to Durham because holders Worcestershire Rapids fell to a seven-wicket defeat at Northamptonshire Steelbacks and missed the chance to move above the Trent Bridge outfit.
Worcestershire face a trip to Sussex in the last eight in a repeat of last season’s final, while Lancashire Lightning secured top spot in the group by beating Leicestershire Foxes by five wickets.
In a dead rubber, Tom Kohler-Cadmore’s unbeaten 94 from 63 balls helped Yorkshire Vikings to a 19-run win at Birmingham Bears.