Babar Azam has replaced Sarfaraz Ahmed as Pakistan's Twenty20 captain until next year's T20 World Cup in Australia, and Azhar Ali has been appointed test captain for the 2019-20 season.

The change in captaincy comes after Pakistan was beaten 3-0 by Sri Lanka last week in a Twenty20 series in Lahore.

In the T20 series, Sarfaraz had scores of 24, 26 and 17 against a second-string Sri Lanka as Pakistan failed to chase in all three matches.

Pakistan's Babar Azam is dismissed by Sri Lankan bowler during the second Twenty20 match between Pakistan and Sri Lanka in Lahore, Pakistan, Monday, Oct. 7, 2019. Sri Lanka won the toss and elected to bat in the second Twenty20 against Pakistan. (AP PhotoK.M. Chaudary)

Pakistan's Babar Azam is dismissed by Sri Lankan bowler during the second Twenty20 match between Pakistan and Sri Lanka in Lahore, Pakistan, Monday, Oct. 7, 2019. Sri Lanka won the toss and elected to bat in the second Twenty20 against Pakistan. (AP PhotoK.M. Chaudary)

"His (Sarfaraz) loss in form and confidence is visible and in the best interest of the team it has been decided to leave him out and provide him the opportunity to reflect and regroup himself and try to reclaim his form away from international cricket," Pakistan Cricket Board chairman Ehsan Mani said in a statement on Friday.

Pakistan is due to leave for Australia next week to play three Twenty20s and two test matches and the PCB said the squads for both series will be announced on Monday.

Babar was the vice-captain during the T20 series against Sri Lanka and is presently leading Central Punjab in the National T20 Cup, where he scored a 59-ball 102 against Sindh.

Babar previously led Pakistan in the Under-19 World Cup in 2012. However, he has no experience leading the national team in big time international cricket.

But the world's top-ranked Twenty20 batsman said he was ready for the challenge.

"To be named captain of the No. 1-ranked side in the world is the biggest thing that has happened to my career to date," Babar said. "I am ready for this challenge and also willing to learn more in the process. I feel it has been a natural progression for me and I am delighted that the PCB has put faith in my capabilities."

Pakistan, ranked No. 7 in test cricket, had an unimpressive record since Sarfaraz took over from now-head coach and chief selector Misbah-ul-Haq three years ago. Pakistan won only four test matches and lost eight during that period.

"These are exciting times in Pakistan cricket with a new team management," Azhar said. "As a captain, I feel comfortable that there will be number of knowledgeable people in the hut who I can rely on for advice and guidance."

The 34-year-old Azhar has played 73 test matches and scored 5,669 runs with 15 centuries.

The PCB also said it will name the ODI captain at a later date because Pakistan's next international assignment is against the Netherlands in July.

More AP cricket: www.apnews.com/cricket and https://twitter.com/AP_Sports