The incident took place in the 111th over of the Sri Lankan innings on Day two when Sri Lanka was looking to post a big total, when their score read 336-4.
With this loss, Pakistan have fallen to the seventh spot in the ICC Test rankings ─ a stark difference from their position on top of the rankings previous year, when Misbah-ul-Haq was captain of the team.
After the Test series whitewash, Pakistan will play Sri Lanka in five ODIs.
Off-spinner Dilruwan Perera took three wickets to push Sri Lanka closer to an impressive win on the fourth day of the second and final day-night Test in Dubai on Monday.
Resuming at the overnight 198-5, Pakistan started its pursuit positively on the fifth afternoon of the day-nighter with Ahmed and Shafiq attacking to lift the score to 225-5.
It is believed that several of the Sri Lankan players want to help Pakistan in its quest to bring back global cricket but will wait for approval from the independent security committee before making up their decision.
Sri Lanka, who won the first Test in Abu Dhabi by 21 runs, also became the first team to beat Pakistan in a Test series in their adopted home of the UAE.
Asad Shafiq scored a valiant 112 for Pakistan.
A paddle to fine leg for a single brought up his 11th Test hundred, before he was dropped from his next delivery by Dimuth Karunaratne at slip off the bowling of Dilruwan, whose disappointment was soon alleviated as Sarfraz top edged a sweep and was well held at fine leg by Nuwan Pradeep.
Pakistan head coach Mickey Arthur is hopeful his team can claw their way to a famous win. Captaincy is very different in Tests - as things changes session by session. Dilruwan Perera successfully too a five-wickes while Suranga Lakmal was also responsible for the wicket of Asad Shafiq.
Did Pakistan err by fielding only one specialist spinner in Yasir Shah? So, by scoring just 52 runs, the Green Army lost their five precious wickets. He, along with Azhar Ali, added 35 runs for the second wicket in 23 overs.
That leaves Pakistan, already struggling with the ball in this Test, a bowler short going ahead - with only one specialist spinner and with Wahab Riaz enduring his own problems at one stage with his run-up. Sri Lanka presented a target in front of Pakistan by playing their second innings.
But Mendis (29) and Rangana Herath (17) added 35 for the eighth wicket to frustrate Pakistan before Sohail struck thrice in his only over to give his team hope of an upset win.