Gautam Gambhir struck his first century for Essex as his side piled on the pressure in their LV= County Championship clash with Gloucestershire at Bristol.
India left-hander Gambhir hit 106 in a 201-run opening partnership with Jaik Mickleburgh, with the visitors making 285 for four before declaring on the third evening.
Gloucestershire require a further 413 on the final day after closing on 19 without loss when bad light set in, with much resting on captain Michael Klinger and Chris Dent.
An unbeaten maiden first-class fifty by Craig Miles, part of an unlikely 78-run stand for the last wicket with Graeme McCarter, had earlier ensured Klinger's side avoided the follow-on.
Tail-enders Miles and McCarter were greeted first up with a hostile spell from left-arm paceman Tymal Mills, tearing in from the Ashley Down Road end, yet both showed admirable heart as well as technique.
Miles, 19, is probably only batting at number 11 due to his tender years and he became only the sixth Gloucestershire player to make a half-century in that position with some handsome drives and sensible back-foot manoeuvring.
His wicket remained intact but the hosts were eventually all out when the similarly impressive McCarter was run out by Reece Topley's direct hit from deep backward square, meaning the deficit stood at 146.
That stretched to 178 by the start of the second session, heightening Gloucestershire's need for quick wickets to avoid being cut adrift in the contest.
Instead Mickleburgh and Gambhir struck the right balance between attack and defence, the latter the first to reach 50 off 72 balls with the aid of seven boundaries.
The 31-year-old from Delhi averages 44.18 from 51 Test matches and at times overwhelmed the youthful Gloucestershire attack.
Mickleburgh required 116 deliveries to achieve the same feat, and six overs later Gambhir signalled the visitors' intent when he launched Benny Howell for six into the building site.
A virtually identical shot by Mickleburgh yielded the same result before Gambhir reached a 141-ball hundred with a single off David Payne, and by tea Essex had amassed a huge advantage of 337 at 191 without loss.
Gambhir departed eight balls after the resumption, hooking Miles to Hamish Marshall on the square-leg boundary, having faced 149 balls and hit 12 fours and a six.
Mickleburgh holed out for 86 to the same fielder off Tom Smith in the next over and spinner Smith dismissed his namesake Greg for 40 via Alex Gidman's tumbling catch at backward point.
Owais Shah was then pinned leg before by Miles before Ryan ten Doeschate made a run-a-ball 23 before the declaration came and Gloucestershire's reply started steadily.