A career-best 93 from Will Gidman salvaged a draw for Gloucestershire and ensured Middlesex's 100 per cent record in LV= County Championship Division Two came to an end at Bristol.
Middlesex looked on course for victory when Gidman was joined in the middle by Liam Norwell with Gloucestershire on 263-8 and holding a lead of 215.
But 26-year-old Gidman, who struck 10 fours and a six, and teenager Norwell (26) put on 75 for the ninth wicket and Gloucestershire were eventually bowled out for 347.
That left Middlesex requiring 300 in 50 overs to register a fourth successive win, but the visitors effectively gave up the chase after openers Chris Rogers (5) and Scott Newman (16) were both dismissed by Jon Lewis (3-35) inside seven overs.
They had reached 123-4 with 20 overs remaining when umpires Mark Benson and Nick Cook took the players off for bad light, and no resumption was possible.
Middlesex, who remain top of Division Two, took 11 points from the game and third-placed Gloucestershire took 10.
A career-best innings of 72 from Ian Cockbain helped Gloucestershire retain hopes of a victory against Division Two leaders Middlesex at Bristol.
The visitors, who are chasing a fourth straight win, were dismissed for 406 in their first innings before Gloucestershire reached 218-5 by close on day three, a total lead of 170.
The home side had been toiling on 128-5 as Cockbain was offered precious little support by the rest of the top order.
However, first-innings centurion Chris Taylor (60 not out) put together and unbroken stand of 90 with Will Gidman (25no) to set up an intriguing final day.
Middlesex had earlier added 110 to their overnight total of 296-4 with much of that coming via Ollie Rayner, the number nine making 54 from 62 balls before being caught lbw by Jon Lewis, who finished as the pick of the bowlers with 5-65.
Chris Rogers hit 87 on Thursday as Division Two leaders Middlesex reached 296-4 in reply to Gloucestershire's 358 on day two of their match at Bristol.
The Australian, who hit a career-best 319 for Northamptonshire against the same opposition in 2006, struck 15 boundaries in his 123-ball innings before he was caught behind driving at Liam Norwell.
Scott Newman (47) and Dan Housego (40) shared in stands of 116 and 53 with Rogers, with Dawid Malan (45) and skipper Neil Dexter (56 not out) then sharing a fourth-wicket partnership of 89.
Starting the day on 302-6, Gloucestershire lost Will Gidman (67) to just the third ball of the day, with Jon Lewis departing in the fifth over as Toby Roland-Jones picked up his fourth and fifth wickets of the innings.
However, a partnership of 41 between Jon Batty (27) and David Payne guided Gloucestershire past 350.
A long-awaited century from Chris Taylor gave Gloucestershire a strong start to their Division Two summit battle with Middlesex, as they closed day one on 302-6.
Taylor reached three figures in the LV= County Championship for the first time since September 2009 as he hit 13 fours in his 147-ball knock of 117.
After a slow start in which only 14 runs were scored in 12 overs, Gloucestershire upped the pace with Hamish Marshall's 62 coming before Taylor and Will Gidman amassed 162 for the sixth wicket to put the hosts in the driving seat.
Toby Roland-Jones was the dangerman with the ball for Middlesex as he took 3-60, while Tim Murtagh took two scalps including that of New Zealander Kane Williamson - who made just 15 on his Championship debut.
Gidman was unbeaten on 67 when umpires Mark Benson and Nick Cook ended play 10 overs early, as the light was deemed too poor to continue.
Second-placed Gloucestershire started the game 20 points behind Division Two leaders Middlesex, who have won all three of their games so far.