Hampshire 322 for 8 (Prest 102*, Harmer 5-143) trail Essex 447 for 9 dec (Rossington 104, Critchley 99, Harmer 62, Yadav 51, Westley 50) by 125 runs
Former England Under-19 skipper Prest masterfully scored an unbeaten 102 to guide Hampshire past the follow-on score with vital contributions from Toby Albert, Fletcha Middleton, James Vince and Keith Barker.
Harmer claimed 5 for 143 as he churned away from the River End for 36 overs but Hampshire ended the day on 322 for 8 - and 125 runs adrift - with the potential to set up a result on the final day.
Albert and Middleton had seen out seven overs the previous evening and combined on the third morning with a mix of patience and skill to clear the new ball with little problems.
Middleton survived a missed stumping, the first of a few missteps from Essex, on 17 as the 21-year-old openers put on 68. But the arrival of Paul Walter's tall left-arm pace to the attack immediately saw the back of Albert, when he pinned him lbw with an in-swinging yorker.
Nick Gubbins pushed to second slip to give Harmer his first before the offspinner bowled a slog-sweeping Middleton for 47.
Vince had arrived with intent to counter and smashed 46 in 45 balls, capped by hitting Matt Critchley back over his head for six.
He and Liam Dawson fell in consecutive overs playing aggressive shots, Vince skying a top edge to long off, while Dawson slogged a sweep from well outside off stump to square leg.
Essex's title hopes looked bright with Hampshire 141 for 5 and in a prime follow-on position, and Surrey collapsing at The Kia Oval against Northamptonshire. But Prest flipped the script by partnering up with the lower-middle order to defy Harmer and bat Hampshire towards a position of strength.
Prest has long been talked about in the same breath as Vince, with his powerful shot-making and wonderful ability to find boundaries. His red-ball form, in his first six outings, had been disappointing, especially compared to his sparkling white-ball record - which included two List A centuries and four Vitality Blast fifties.
Here, he scored 36 of his 69-ball half-century in boundaries with plenty of resilience shown in a dodgy situation for his team. Prest put on 54 with the uneasy Brown - who survived a simple catch at square leg when on one before he was caught off the bat-pad for Harmer's fourth.
Prest was dropped by Harmer at second slip the ball after bringing up his first Championship fifty but was otherwise chanceless, amid turn and invariable bounce from Harmer.
Barker utilised his well-honed reverse=sweep and dipped into his experience to join forces with his young seventh-wicket partner, the pair putting on 89 together. Barker fell trying to pull Sam Cook before Felix Organ gave Harmer his fifth with a misjudged slog-sweep.
Kyle Abbott then stewarded Prest to make sure Hampshire averted the follow-on, which he managed with a pair of sixes in the 77th over. Prest then reached three figures in 119 balls after the second new ball had been taken.
Bad light took the players off just before 4.30pm before rain kiboshed any hope of any more play, as those who stayed in the ground watched Surrey's improving situation being played on the scoreboard.