Captain Misbah-ul-Haq and Younis Khan put on a century partnership to rescue Pakistan and leave the first Test against Zimbabwe in Harare finely poised.
The hosts had established a first-innings lead of 78 after posting 327 all out in the morning and Pakistan looked in serious trouble as they slumped to 23-3 early in the afternoon session.
But Misbah and Younis steadied the ship with a partnership of 116 for the fourth wicket to help guide the tourists to 168-4 by the close of day three and a lead of 90.
Zimbabwe have not beaten an established full-member nation in the Test arena since their four-wicket success over India 12 years ago but were giving themselves more than a fighting chance of victory in Harare.
The home side began the day on 281 for seven, a lead of 32, and made steady progress through the first hour.
Elton Chigumbura hit Rahat Ali for four in the third over of the day before Shingi Masakadza survived a huge lbw appeal off Saeed Ajmal.
In the following over Chigumbura brought up his half-century with a single off Junaid Khan. The 27-year-old had taken 98 balls to reach the milestone, with six fours, but his partner at the other end was upping the pace, plundering six off the next over to help take Zimbabwe past 300.
Masakadza was soon gone for 14, though, as Ajmal got one to drift in and trapped him plumb in front to claim his fifth wicket.
And he was to claim two more in quick fashion as first Chigumbura (69) saw an inside edge lob up off the pad to Azhar Ali and, from the next ball, Tendai Chatara edged to second slip for a golden duck to end the innings.
That gave Ajmal impressive figures of 7-95 but Zimbabwe will have been pleased with their first-innings lead.
They then managed to remove Khurram Manzoor (five) in just the sixth over of Pakistan's reply as Tinashe Panyangara trapped him lbw.
Azhar was next to go in the first over after lunch as Panyangara had another leg-before victim and Pakistan were really teetering as Mohammad Hafeez lofted a drive to Tino Mawoyo at extra cover off Chatara.
A collapse looked on the cards with two fresh batsman at the crease but Younis and Misbah are the most experienced men in the side and they saw Pakistan through to tea in conservative fashion.
The pace did not pick up in the evening session with just 81 runs being added but Younis brought up his half-century off 119 balls with six fours.
Misbah then reached his milestone off 136 deliveries with four boundaries and the century partnership was brought up off 251 balls.
Zimbabwe were getting frustrated and saw a couple of tight stumping decisions go against them before taking the vital wicket of Misbah for 52 - the skipper tried to drive Masakadza off the front foot but could only loop the ball up to Vusi Sibanda at cover.
That brought Asad Shafiq to the crease and he was on 15 at the close, with Younis finishing the day unbeaten on 76.