Pakistan produced not one but two fightbacks on day three of the second Test against Sri Lanka in Dubai, which ended with them trailing by 91 runs.
After dismissing Sri Lanka, who had begun the day on 318 for four, for 388, Pakistan slipped to 19 for three before half-centuries from Younus Khan and Misbah-ul-Haq helped them recover.
Both men were unbeaten as they closed on 132 for three in their second innings.
Sri Lanka added just two runs to their overnight score before losing their first wicket when captain Angelo Mathews edged Rahat Ali to Sarfraz Ahmed for 42.
Junaid Khan bowled Prasanna Jayawardene (9) and Rangana Herath was run out by Rahat for six before centurion Mahela Jayawardene finally fell for 129.
He faced 278 balls and hit 15 fours but his innings came to an end when he missed the ball attempting to reverse sweep Saeed Ajmal to be bowled. It was Ajmal's first wicket after 28 fruitless overs.
Shaminda Eranga (14) and Suranga Lakmal (10) frustrated Pakistan before Bilawal Bhatti bowled the former and Ajmal grabbed his second wicket when he trapped Nuwan Pradeep in front for three.
Junaid emerged as the pick of the bowlers with figures of three for 102, Rahat Ali returned two for 131, Ajmal two fro 56 with Bhatti and Mohammad Hafeez taking a wicket apiece.
Sri Lanka's final six wickets fell for 68 runs and represented Pakistan's first fightback of the day - after they managed just 165 in their first innings, it was badly needed to keep them in the game.
However, when Pradeep had Khurram Manzoor (6) and Hafeez (1) caught behind by Prasanna Jayawardene and Herath had Ahmed Shehzad (9) dismissed in the same fashion, things were looking desperate for Pakistan.
A five-over burst from Sri Lanka saw them pick up three wickets for six runs.
Fortunately for Pakistan, their most experienced pair were at the crease. Younus and Misbah proceeded to bat out the remaining 42.1 overs for no further loss of wickets.
This was their ninth century partnership in Tests together and with Sri Lanka's four-pronged bowling attack giving them a stern test, they produced a superb response.
Younus ended up unbeaten on 62 in 142 balls, hitting four fours while Misbah made 53 in 119 with five fours and a six as the pair, once in, took opportunities to score when offered.
Nevertheless, despite their 113-run stand, as a team Pakistan know they have to put on as many runs again just to hand Sri Lanka a token target, and then bat on for as long as they can after that to put real pressure on for the remainder of the match - either to salvage a draw, or pick up an unlikely win.
The opening match in Abu Dhabi was drawn in similar circumstances when Sri Lanka scored 480 for five in their second innings to put the game beyond Pakistan, who had up to that point been in control.
© Cricket World 2014