ABU DHABI, United Arab Emirates (AP) — Angelo Mathews closed in on a well-deserved second test century on Friday as the Sri Lanka captain fought back to take his team to 355-5 on the fourth day of the first test against Pakistan and extend the lead to 176.

Pakistan toiled hard and got the lone success by tea on Day 4 when Dinesh Chandimal (89) missed his century and was caught at fine leg after hitting 12 fours.

Mathews was batting on 87 with nine fours and a six while Prasanna Jayawardene was not out on 14 as Sri Lanka scored 70 runs in the second session.

Mathews and Chandimal frustrated bowlers for nearly 3½ hours and put on 138 runs after Sri Lanka resumed at a struggling 186-4 — a lead of only seven runs.

Pakistan failed to cash in on its lone chance when Ahmed Shehzad could not judge a sharp edge of Chandimal in fast bowler Bilawal Bhatti's first over after lunch.

But the chance didn't prove that costly as Chandimal, who showed lot of patience by facing 166 balls, finally holed out to Rahat Ali to give Junaid Khan (3-79) his third success of the innings.

Earlier, Chandimal resumed on 24 and moved to 67 by lunch while Mathews also completed his half century to revive Sri Lanka by adding 99 runs.

Pakistan had Sri Lanka in trouble at 186-4 on the third day when fast bowler Bhatti claimed key wickets of experienced Kumar Sangakkara (55) and Mahela Jayawardene in quick succession, and Khan had opening batsman Kaushal Silva (81) caught behind.

But the Pakistan pacers struggled to get through to the defenses of Chandimal and Mathews and even the second new ball didn't bring them any success in an extended 2½-hour first session due to Friday prayers.

Both batsmen showed a lot of grit against the Pakistan pace trio of Khan, Bhatti and Rahat Ali while offspinner Ajmal also couldn't find much turn to bother batsmen.

Just before play started, Pakistan wicketkeeper Adnan Akmal was ruled out of the remainder of the test series after fracturing his index finger.

Akmal was hit on his left index finger when he caught Silva in the last over of the third day on Thursday.

The Pakistan Cricket Board said in a statement Friday that Sarfraz Ahmed will be flown in for the remaining two matches in the series.

Ahmed played in last year's three-test series in South Africa before Akmal regained his place in the national team.

Younis Khan replaced Akmal behind the wickets when play resumed on the fourth day.