Defending champions Pakistan were pushed hard by minnows Afghanistan before completing a 72-run victory in their Asia Cup match in Dhaka.
In desperate need of a win after losing their tournament opener to Sri Lanka on Tuesday, Pakistan had Umar Akmal to thanks as his unbeaten century helped Pakistan post 248-8 batting first.
Afghanistan, who have never beaten Pakistan in any format, looked on course to spring a surprise before plummeting from 139-2 to 176 all out in 47.2 overs.
Misbah-ul-Haq's men were in trouble in the early stages after losing the toss and slipped to 117-6 six before Akmal's brilliant unbeaten 102 from 89 balls - his second ODI century - steered them away from trouble.
The Pakistan openers were restricted to just 39 runs from the first 10 overs and the pressure told on Sharjeel Khan (25), who swept a Hamza Hotak delivery straight to Noor Ali at mid-wicket.
Mohammad Hafeez (10) was next to go as Nabi caught him off the bowling of Mirwais Ashraf and Pakistan were labouring somewhat at 80-2 after 20 overs.
It got worse shortly afterwards as first Ahmed Shehzad fell two balls after making his fifty, inside-edging onto the stumps from a Samiullah Shenwari delivery, and then Misbah was run out in calamitous fashion without facing a ball.
Sohaib Maqsood drove into the covers but a mix-up with the call meant that both batsmen found themselves at the same end to leave Pakistan 89-4.
That brought Akmal to the crease but his impact was not to be instantaneous and when Maqsood (13) and then Shahid Afridi (six) both fell the score was a precarious 117-6.
Akmal was yet to pick up the pace and survived a scare on 28 as Shenwari dropped him off the bowling of Shapoor Zadran.
He and Anwar Ali put on 60 together before the latter fell for 21 with 7.2 overs remaining, bringing Umar Gul to the crease who helped push the score beyond 200 with 15 off 12 balls.
Akmal had been going at around a run a ball up to that point but he opened his shoulders in the final two overs, each of them yielding 13 runs, and brought up his hundred in style with a six in the final over.
Mohammad Shahzad hit the first ball of the reply for four and that set the tone for a brisk start with Afghanistan going at around a run a ball before Shahzad (nine) fell off the final delivery of the fifth over.
Shehzad's exit saw the run-rate slow to below four and Ali's exit for 44, lbw to Saeed Ajmal, brought Nawroz Mangal to the middle.
He and Asghar Stanikzai put on 74 for the third wicket but it was slow going with just five boundaries scored in 18 overs before the latter (40) was caught by Hafeez off the bowling of Afridi.
Mangal (35) was gone two balls later after tentative running led to him being run out, leaving Afghanistan 140-4 and needing nine an over off the last 12.
Najibullah Zadran chopped on from Hafeez shortly after for just one and when captain Nabi (15) was lbw to Gul there was no way back for Afghanistan as the tail quickly evaporated.
Hafeez (3-29) was the pick of the Pakistan bowlers and his haul helped the defending champions claim a much-needed bonus-point win.