Pakistan thwarted a spirited career-best century by Danushka Gunathilaka to defeat Sri Lanka by five wickets in the third and final one-day international in Karachi on Wednesday, taking the three-match series in the process.

Gunathilaka’s 134-ball 133 lifted Sri Lanka to a challenging 297-9 in their 50 overs but Pakistan chased down the target in 48.2 overs for their first series win in 15 months.

Pakistan won the second match by 67 runs while the first match was rained off without a ball being bowled – both also in Karachi.

Pakistan were indebted to Fakhar Zaman (76) and Abid Ali (74) who provided a solid 123-run opening stand in 20 overs before Haris Sohail (56) and Iftikhar Ahmed chipped in with a 22-ball 28 not out.

Pakistan needed 37 in the last five overs as Iftikhar cut loose, hitting a six and a boundary to bring up victory – Pakistan’s eighth consecutive ODI win over Sri Lanka since 2017.

Sohail and Iftikhar hit three fours and a six apiece.

Abid drove 10 well-timed boundaries in his 67-ball innings and looked set for his second hundred in his fourth ODI before he was trapped leg-before by spinner Wanindu Hasaranga.

Zaman hit seven fours and a six in his 91-ball knock before becoming paceman Nuwan Pradeep’s first of two wickets for 53 runs.

Babar Azam, who struck a brilliant hundred in the second game, made 31 before being trapped lbw by Pradeep while skipper Sarfaraz Ahmed managed 23.

Earlier, Gunathilaka anchored Sri Lanka’s innings after they won the toss and batted.

The 28-year-old left-hander hit 16 fours and a six for his second ODI hundred.

Gunathilaka, suspended twice for breaches of discipline in the last two years, held the innings together with stands of 88 with skipper Lahiru Thirimanne (36) for the second wicket, 50 for the third with Angelo Perera (13) and 74 with debutant Minod Bhanuka (36) for the fourth.

He was finally dismissed in the 45th over, bowled by paceman Mohammad Amir who was the best Pakistani bowler with 3-50.

It was Amir who gave Pakistan an early breakthrough when he had Avishka Fernando caught behind for four by Sarfaraz who was leading Pakistan for the 50th time in an ODI.

Gunathilaka defied Pakistan’s bowling with guts and determination, improving his previous ODI best of 116 he made against Zimbabwe at Hambantota in 2017.

Thirimanne hit four boundaries off 54 balls while Bhanuka had two sixes in his 39-ball knock.

All-rounder Dasun Shanaka hit a 24-ball 43 with five fours and two sixes as Sri Lanka added 50 in the last five overs.

The two teams will now play three Twenty20 internationals – all in Lahore – on October 5, 7 and 9.