Middlesex were left hoping for a Warwickshire win against Hampshire to save them from relegation after falling to a 231-run defeat against Somerset at Taunton.

Jack Leach went past 50 Specsavers County Championship wickets for the season as the hosts ensured their own survival and left the 2016 champions on the brink.

Only a Hampshire defeat at Edgbaston will save Middlesex from Second Division cricket next season, but they had reached 64-1 at lunch, needing another 194 to win.

Leach finished with 5-57 as Middlesex were bowled out for 113 on the final day, from an overnight 40-3, when chasing a highly improbable 345 for victory.

Roelof van der Merwe weighed in with 4-22 and Somerset took 20 points to leapfrog Middlesex, who claimed just three, in the table.

Stevie Eskinazi was first to go when, having made 16, he pushed forward to van der Merwe and edged to the kneeling Marcus Trescothick at second slip.

The 41-year-old former England opener has adopted that position in recent games to protect his back and was not praying for the victory that would keep his hopes of winning a Championship title with his beloved county alive.

The score had moved to 71 when Adam Voges played forward to Leach and edged a comfortable catch to Craig Overton at first slip.

The left-arm spinner, considered by many unlucky not to have made the Ashes squad, brought up his 50 wickets when John Simpson, who had looked to counter-attack with two fours and a six, fell leg-before for 19.

On a pitch that has turned throughout, van der Merwe proved an excellent selection by Somerset as third spinner and had Paul Stirling snapped up by Overton at slip to make the score 80-7.

The South African all-rounder quickly followed up as James Harris top-edged a sweep and departed for 13.

At 93-8, home supporters prepared to celebrate, but Tim Murtagh lofted a six over mid-wicket off van der Merwe before being bowled in the same over. And when Leach had an lbw appeal against Steven Finn upheld by umpire Mike Burns it sparked wild celebrations from a Somerset team, who looked doomed to the drop before winning three of their last four matches.

It was a satisfying end to his time as Somerset director of cricket for Matthew Maynard, the club having announced last night that he is leaving. The club intend to appoint a replacement and a new head coach in the near future.

The word is that the pitch will be marked no worse than below average and as Somerset have not had any other wicket deemed in that category over the past 12 months, there should be no question of any docked points.