Pakistan's record of never having lost a test cricket series in the United Arab Emirates ended on Tuesday when Sri Lanka won the second match by 68 runs and swept the series. (Match Scorecard).
The Gulf country has been Pakistan's home away from home since 2010, but the host couldn't overhaul Sri Lanka twice on the final days of both tests.
Chasing 317 to win, Asad Shafiq scored a valiant 112 before Pakistan was bowled out for 248 inside the first session on day five.
Sarfraz Ahmed scored a fighting 68, but when offspinner Dilruwan Perera induced a top edge of the Pakistan captain's mistimed sweep and broke the 173-run stand with Shafiq, Pakistan lost its last five wickets for 23 runs.
Sri Lanka made 482 and 96, and dismissed Pakistan for 262 and 248.
"We are over the moon," Sri Lanka captain Dinesh Chandimal said.
"The boys executed the game plan really well in this series. Last night, it was a little difficult to bowl, especially with the dew (but) we knew when we come today, it will grip more. We knew Dilruwan and Rangana (Herath) would do the job."
Perera grabbed 5-98 and Herath 2-57, taking the last wicket.
Pakistan ranked No. 1 a year ago, will drop to No. 7, below Sri Lanka, which began the series as the underdog. Sri Lanka's confidence was down after losing every match during a visit by India recently, followed by a first five-match series loss to Zimbabwe in one-day internationals.
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. However, they rode their luck.
Ahmed survived a stumping on 65, and in the same over, Shafiq reached his 11th test century, off 151 balls. The next ball, Shafiq was dropped at first slip, and on 103 he successfully overturned an lbw decision against him.
Ahmed was out seven balls before the new ball was available, then seamer Suranga Lakmal finally broke through Shafiq's defenses when he found an outside edge with the second new ball. Shafiq hit 10 boundaries in his attacking knock off 176 balls.
Herath wrapped up Pakistan's innings when last man Wahab Riaz was caught by Chandimal.
"It was a tough series for us, we came close in both matches," Ahmed said after being whitewashed in his first test series as Pakistan captain since the retirement of Misbah-ul-Haq this year.
"Test captaincy is a little difficult and I've learnt a lot. The boys are new as well and they'll learn. We'll do better in the future.
"Our preparations were fine, but we just missed big partnerships."
The teams begin a five-match one-day international series, starting on Friday. That will be followed by three Twenty20s, with the last T20 scheduled to be played at Lahore.