Somerset 449 (Chawla 112, Barrow 65, Trescothick 64, Patel 4-89) beat Middlesex 106 (Chawla 3-8, Meschede 3-25) and 164 (Gregory 5-38) by an innings and 179 runs

The battle at both ends of the Division One table looks likely to go to the wire. But when Somerset finally set course for the west country tonight several hours after sealing a stunning victory with nearly five sessions to spare, they did so safe in the knowledge that survival is once again in their own hands.

Marcus Trescothick and his team were reluctant to tear themselves away from the home of cricket, wishing to savour an innings victory - their first in a Championship fixture at Lord's since 1983 - for as long as possible.

"You never get tired of playing here," Trescothick said. "So we're not shooting off too quickly because we want to hang around and enjoy what we've achieved."

What Somerset had done, in simple terms, was to lift themselves out of the relegation places. And with home fixtures to come, starting next week, against first Derbyshire and then Surrey - the two sides below them - before finishing the campaign at Trent Bridge, top flight status is now theirs to lose.

The mood was entirely different, of course, in the other dressing room at Lord's. Middlesex's title challenge, which looked so potent before last week's shock defeat in Derby, is now all but over. Director of cricket Angus Fraser was in no mood to pull any punches, describing the team's batting performance as "unacceptable", and his men now face a real test of character against Surrey next week.

But poorly though the hosts played, this match should be remembered most for a terrific Somerset performance that was a world away from many they have produced this season - and much more in keeping with what friends and foes expected of them during 2013.

In danger, by just after tea on the first day, of being dismissed for less than 250, they saw their last three wickets add 238 runs with new recruit Piyush Chawla contributing a priceless century from No 9.

Then, once Middlesex started batting, an attack which had looked threadbare before start of play - with Steve Kirby and Peter Trego missing through injury - put the title hopefuls under enormous pressure.

At 19, Jamie Overton (who joins England next week for a possible one-day international debut) was easily the best known of the three front-line pace bowlers. But it was two 21-year-olds, Lewis Gregory and Craig Meschede, who did most of the damage - Meschede striking three times in the first innings and then Gregory claiming a first ever five-wicket haul second time around once the follow-on was enforced.

The outside edge was found with regularity and almost every catch was held (five of them in the second innings by Trescothick, at second slip) as Somerset refused to give the home side a hint of respite. Their only other victory of the season had been a nerve-shredder at Derby but this one was complete in almost every aspect.

"It's amazing really - an outstanding victory," said Trescothick. "I thought we played brilliantly well. Bar one session on the first day when we lost a few wickets and put ourselves under pressure we were pretty clinical throughout so I'm delighted."

Trescothick acknowledged that his team's first innings fightback from 211 for 7 had been vital. "To end up with 450 was huge because the pitch was nibbling around a bit," he said. "And then our bowlers were outstanding and we asked their batsmen a lot of questions.

"Lewis Gregory has been taking the new ball in the second team and bowling nicely and we know with Craig Meschede that when he gets on a wicket that seams about a bit he can be lethal and rip through teams."

"What we have to do next week against Derbyshire is get ourselves back into this frame of mind because if we play like this we can beat anyone. That's our challenge."

As for Middlesex, this is not the first time they have lost back-to-back Championship matches - they did so against Yorkshire and Warwickshire in mid-summer. But falling to Derbyshire last week and now disintegrating against Somerset will surely prove a double too far when it comes to trying to capture the title.

In some ways, they have done well to get this far into the race without slipping away because much of their batting has been suspect all season. Joe Denly has made it beyond fifty just three times with Dawid Malan failing to reach even that small milestone while averaging in the mid-teens.

Neil Dexter did make a century, against Sussex, but has not added to it and No. 6 John Simpson has a best of 97 not out but not much else to write home about.

"We batted very poorly in both innings - to be bowled out twice in a day on a surface like that is unacceptable," said Fraser. "Everybody knows that. We don't have to go ranting and raving. What you hope is that it is a one off and the challenge is to make sure that next week we play a lot better and the players show the character to come through and bat as we know they can."