Sikandar Raza hit a gritty 97 not out to help Zimbabwe recover from a top-order collapse and stretch their second innings lead over Sri Lanka to 262 in the one-off Test on Sunday.
The visitors were 6-252 at stumps on day three, with Raza and Malcolm Waller (57) putting on an unbeaten 107-run stand for the seventh-wicket at Colombo's R Premadasa Stadium.
Raza lifted Zimbabwe from a precarious 4-23, followed by 5-95, after Sri Lankan left-arm spinner Rangana Herath rattled the visitors' batting with four early wickets.
Herath, who got three wickets before the lunch break, bowled Sean Williams for 22 in the second session as Zimbabwe teetered dangerously close to losing their 10-run advantage.
It was then that Raza put together 86 runs with Peter Moor (40) for the sixth wicket to turn the tables on Sri Lanka. Moor fell to paceman Lahiru Kumara.
Raza, who registered his fifth Test fifty, used the sweep shot to great effect against the spinners as he found another partner in Waller to thwart the Sri Lankan bowling attack.
"The dressing room was very quiet after the lunch break as we were 23-4. Then we said to ourselves, let's fight back and show that we mean business," Waller told reporters.
"We have created history in the ODI series and we have a great chance here as well. If we can get another 100 runs that will give us a good chance to win this Test," Waller, whose side eye their first-ever Test win over Sri Lanka, added.
Earlier skipper Graeme Cremer helped Zimbabwe take the lead after claiming his maiden five-wicket haul in a Test, helping bowl Sri Lanka for 346 in the morning session.
But it was Herath's left-arm spin that undid the fine work from leg-spinner Cremer (5-125).
Herath, who registered his 30th Test five-wicket haul on the opening day, ran riot at the start of Zimabwe's second innings to get the wickets of Hamilton Masakadza, Tarisai Musakanda and Regis Chakabva.
Off-spinner Dilruwan Perera joined forces to get the prized wicket of first-innings centurion Craig Ervine for five at the stroke of lunch.
Sri Lanka's interim coach Nic Pothas, who took over the job after Graham Ford prematurely ended his contract last month, was not surprised by the visiting sides' fighting qualities.
"The fight that Zimbabwe have shown is not surprising at all. They have a quality support staff and they have some fine players," said Pothas, who represented South Africa in three ODIs.
"I have played against Zimbabwe when I was playing for South Africa and they used to always put up good fights."