SHARJAH, United Arab Emirates (AP) — Mohammad Hafeez regained his batting form in one-day internationals with a gritty 122 off 129 balls as Pakistan tallied 322-5 against Sri Lanka on Wednesday.

Hafeez scored just 93 runs against South Africa in the last six ODIs but came back strongly by hitting seven fours and four sixes after Pakistan won the toss and elected to bat first.

Hafeez set the tempo for a big total by sharing 83 runs with debutant opener Sharjeel Khan (61) for the second wicket then putting on better than a run-a-ball 140 runs with Sohaib Maqsood (73).

Shahid Afridi hammered 34 off 11 balls as Pakistan added 64 runs in the last six overs to post its best ODI total in 2013.

Left-hander Khan, who impressed in the drawn Twenty20 series against Sri Lanka, showed no signs of nerves in his debut ODI when he lofted Lasith Malinga (0-59) over midwicket for a six and took two more boundaries in the fast bowler's second over.

On a perfect batting strip of Sharjah Cricket Stadium, the Sri Lanka bowlers could not contain the flow of runs before Khan was caught on the edge of the long-on boundary and departed after hitting six fours and three sixes in his run-a-ball knock.

Maqsood kept on pressing the accelerator by hitting four sixes and two fours in his 68-ball innings as Hafeez raised his seventh ODI century off 111 balls when he lofted Suranga Lakmal (2-73) over midwicket for a six.

Maqsood also looked set for his maiden century before he was run out in a mixup with Hafeez, who refused to go for the second run.

Afridi took charge and hit three sixes — one of which went out of the stadium over covers off Thisara Perera — and also smashed two fours after he was promoted ahead of captain Misbah-ul-Haq and Umar Akmal.

Hafeez was finally dismissed in the last over when he offered a tired looking catch to Dinesh Chandimal at midwicket to give Lakmal his second wicket.