Somerset 274 (Hildreth 82, Trego 81, Overton 53*, Robinson 4-79) and 208 for 6 (Trego 95*) drew with Sussex 208 (Wells 54, Wright 51, Thomas 4-46) and 490 for 4 dec (Machan 192, Mash 142*, Joyce 66)

A heroic rearguard from Peter Trego and Lewis Gregory saw Somerset through to a nervy draw after the team's propensity to collapse returned on the final afternoon. Coming together after five wickets had fallen in as many overs, Trego and Gregory survived 42 overs in a stand of 120 runs to secure a draw from a match that looked to be heading Sussex's way.

The pair did well to curb their natural attacking instincts and, with men crowded around the bat, play the way the match situation demanded. They looked increasingly assured as the evening session went on, finding the middle of the bat but importantly keeping the ball down and piercing the gaps.

Trego brought up his second half-century of the match, finishing on a magnificent, unbeaten 95, while Gregory, who has struggled with the bat lately, grew in confidence and reached 32 before he was out shortly before the close, his highest score of the summer.

Sussex captain Ed Joyce was left to rue his decision not to have declared his side's second innings closed earlier. After setting Somerset a notional 425 to win in 67 overs, Marcus Trescothick and Tom Abell put on 69 with few causes for alarm. But then as Sussex introduced the part-time spin of Ashar Zaidi and Luke Wells, who only started bowling legbreaks last year, Somerset imploded in a rush of blood.

While there was turn to be had, three of the wickets were gifted to airy shots when there were plenty of runs on offer by playing straight and finding the gaps.

Trescothick decided to target the spinners, taking no time to get a sighter against Wells before he attempted a slog sweep and was bowled for 33. Clearly not learning his lesson from his captain's dismissal, Johann Myburgh went to paddle sweep the same bowler and top edged the ball to short-leg.

Hildreth was possibly unlucky, coming forward to a full toss from to Zaidi which looped up for a caught and bowled chance. Abell, who played beautifully for his 36, pushed forward to one that turned from Wells and got an outside edge to slip. Finally Allenby was caught playing a loose drive outside off stump.

Despite back-to-back wins in Somerset's last two matches, concerns remain about the frailty of their batting. With Tom Cooper scoring a century for the seconds on Tuesday, there may be pressure on places for the game with Middlesex at the weekend.

Matt Maynard, Somerset's director of cricket, was clearly disappointed with his batsmen. "There were too many soft dismissals, some poor execution and poor shot choice," he said. "It's almost like we go through periods where we switch off as a team. It's something we haven't seen much of over the last few weeks, but it was apparent in this game and the guys have to be honest with themselves and be switched on for the full match.

"There was almost a bit of complacency after the start Trescothick and Abell made. But, you see the way Trego and Gregory played, if you apply yourself, if you get stuck in, and understand that at times that's how you have to play to save a game, even if it's not your preferred style necessarily."

Matt Machan and Chris Nash had extended their mammoth stand to 290 in 58 overs, breaking the club's third-wicket partnership record in matches against Somerset in the process. Machan had also been involved in the previous record, also set on this ground, two years ago in a stand with Michael Yardy.

The pair carried on where they left off on Tuesday evening, scoring at exactly five runs an over, but without pushing on as expected towards an early declaration. Machan's long vigil was finally brought to an end as he was bowled by the spin of Abdur Rehman for a superb 192. Rehman then won an lbw appeal against Craig Cachopa, oddly sent in ahead of Luke Wright, but these were just consolation wickets given the Sussex lead was already 382.

Wright tried to expedite things, smashing three sixes off his first five balls from Rehman before rain and bad light brought an early lunch with the lead 402. It was something of a surprise when Sussex re-emerged after the interval to swing the bat for another nine balls, albeit to the tune of 22 runs.

Sussex coach Mark Robinson said gauging the declaration had been a tricky decision. "The wicket has got easier to bat on, but there have been some very big run chases here so we were aware of the history," he said.

Craig Overton was absent during the remainder of Sussex's innings as a result of concussion sustained following the bang on the head he received while batting on Tuesaday. He would have batted again if necessary and Somerset said his absence was purely precautionary.