Middlesex 317 & 405-5 beat Somerset 408 & 310 by five wickets
Adam Voges and James Franklin both hit centuries as Middlesex pulled off a superb run chase at Taunton.
On a dramatic final day, the two close-season signings shared in a brilliant 200 partnership to keep Middlesex on course.
When Voges fell for 132, they still needed 65 from the last 16 overs and briefly the runs dried up.
But Franklin (115 not out) and John Simpson hit 24 in 14 balls to seal the win.
It was a remarkable finish which owed a lot to the groundwork laid by skipper Voges.
Resuming on 31-0, and needing 371 more to win, Middlesex lost Sam Robson (15) and Nick Compton (4) early in the day but Nick Gubbins remained steadfast.
He scored his second half-century of the match and put on 92 with Voges before being bowled by Abdur Rehman for 78.
At lunch, Middlesex were 148-3, requiring 254 more runs, and the Voges-Franklin stand was only just beginning.
Between them they added 132 in the afternoon session and after tea they took the total past 300.
Voges was finally dismissed just after they had clocked up the 200 partnership and it looked as though they might fall short.
Neil Dexter took 29 balls to score just 11 and the required run-rate began to creep up as this four-day match took on a limited overs atmosphere.
When Dexter was bowled, Middlesex needed 21 from the final 21 deliveries – but Franklin and Simpson delivered the goods with an over to spare.
Follow West London Sport on Twitter
Find us on Facebook