Luke Wright hit a magnificent career-best 187 as Sussex pulled off a great escape at Lord's to earn an unlikely draw against Middlesex in the top-of-the-table LV= County Championship Division One clash.
There was still a touch of late drama when Middlesex were left to score 178 from 20 overs, after finally bowling Sussex out for 454, but the teams shook hands after the hosts had carved their way to 50 for three from eight overs.
Joe Denly, Neil Dexter and Gareth Berg all gave their wickets away in a chase that was always going to be a difficult proposition, and Middlesex captain Chris Rogers decided to settle for the draw when the latter was lbw to Chris Liddle.
With five points from the game, Sussex continue to lead Division One, while Middlesex move into second place on the back of their 10-point haul.
Sussex, who began the final day on 228 for four - still 49 runs behind - held on for 137 overs in their second innings after being forced to follow on when they were initially bowled out for 222 in reply to Middlesex's 499 for eight declared.
Wright started the final day on 48, having been badly dropped at deep square-leg on 40 on the third evening, and did not give another chance until he had reached 153 - Rogers putting down a skier as he ran back from mid-off in what proved to be Middlesex's last real chance of winning the game.
Wright batted for just short of six-and-a-half hours and faced 276 balls, hitting 25 fours as he mixed sound defence and superb concentration with enough attacking strokes to keep the Sussex total climbing.
He added 159 for the fifth wicket with Ed Joyce, before the Sussex captain fell to Tim Murtagh in the third over of the second new ball, and then a further 101 for the eighth wicket with Will Beer, whose 102-ball 39 was also crucial to the Sussex cause.
Sussex were just five runs in front when Joyce, who had gone from his overnight 75 to 98, edged to second slip to be dismissed in the 90s for the fourth time in all competitions this season.
It is the second time he has been out for 98 in the championship this summer, after departing on the same score against Surrey at the Kia Oval in late April, and he has yet to make it to a hundred.
Sussex lost their second wicket of the morning session when Ben Brown toe-ended a catch to cover as he tried to cut a short ball from James Harris. When Chris Jordan was then caught at the wicket off Murtagh from the first ball after lunch, with the visitors only 27 ahead, a Middlesex win looked certain.
Wright, however, found Beer more than willing to dig in and, for the second time in the match, they frustrated the Middlesex attack.
Their first-innings partnership of 88 was bettered this time, with Beer hitting four boundaries in a 102-minute stay.
The 24-year-old, in only his third championship appearance, batted for more than four hours in the game for his 64 runs.
When Beer was finally taken at backward short-leg by Berg, off Ollie Rayner, it was left to Wright to shepherd Sussex's last two batsmen to safety.
With Steve Magoffin content merely to defend in a stand of 46, Wright began to hit out after passing his previous career-best of 155 not out, against MCC at Lord's in 2008.
After a flurry of fours off both Rayner and Murtagh, Wright missed another attempted big hit as he went down the pitch to Denly's leg spin and was stumped.
Magoffin then pulled a long-hop from Denly straight to midwicket, forcing Middlesex to have a token attempt at reaching their stiff 20-over target.