Sikandar Raza led the way with a career-best innings as Zimbabwe produced a superb lower-middle-order recovery to forge a position of unexpected strength on day three of their sole Test with Sri Lanka in Colombo.
When the tourists slumped to 23-4 and 59-5 at the hands of Rangana Herath (4-85) after earning a slender first-innings lead of 10, the prospects of a Zimbabwe victory appeared slim.
However, Raza responded in style by striking 97 not out and received able support from Peter Moor (40) and Malcolm Waller (57 not out) as Graeme Cremer's side reached 252-6 at stumps to move 262 ahead.
Cremer had earlier completed a five-wicket haul as Sri Lanka, who had begun Sunday on 293-7, were limited to 346 all out.
The Zimbabwe skipper ousted Suranga Lakmal (14) and the injured Asela Gunaratne (45) to finish with 5-125, after Herath had been stumped off Sean Williams for 22 to end an eighth-wicket stand of 48.
Herath's variations then bemused Zimbabwe's top order, the veteran spinner striking in three successive overs to remove Regis Chakabva, Tarisai Musakanda and Hamilton Masakadza.
And Sri Lanka appeared in command when first-innings centurion Craig Ervine was caught at slip off Dilruwan Perera, leaving Zimbabwe four down at lunch with a lead of only 33.
Although Williams was bowled by a beauty from Herath, the afternoon session was otherwise profitable for Zimbabwe as Raza and Moor steadied the ship.
Moor pulled Lahiru Kumara to deep square-leg early in the evening, but Raza - utilising the sweep on a regular basis - continued to prosper and found another willing ally in the aggressive Waller, who brought up his half-century from just 54 balls.
By the close, Raza was on the brink of a maiden Test hundred and his partnership with Waller was worth 107.