Treasury secretary-general Ismail Bakar will replace Ali Hamsa as the chief secretary to the government.

Ali, who held the highest post in the civil service since 2012, posted on Twitter this afternoon that he is handing over his duties to Ismail.

"I have passed the Duty Handover Note to Ismail Bakar who will be replacing me as the 14th KSN (chief secretary). All the best Datuk Seri," he said.

In a press release later, Ali thanked Prime Minister Dr Mahathir Mohamad and his cabinet members for their cooperation and the civil service.

"The dedication and integrity of the civil service are critical. We have always carried out our responsibilities to the best of our abilities in administrating the nation and taking care of the people's wellbeing.

"This has been proven through a series of action that had been taken towards several attempts to undermine the government's administration," he said.

He also thanked the Council of Eminent Persons' chairperson Daim Zainuddin and his fellow members for their guidance and views in ensuring the best practice of governance.

Previously, speculation had been rife that Ali's contract would not be extended following its expiration on Aug 29.

This is despite the previous administration, which renewed his contract in 2015, giving him an extension until August 2020.

It was reported that while Ali's contract had been extended in March before BN lost the general election on May 9, it was up to Prime Minister Dr Mahathir Mohamad to decide on his fate.

Meanwhile, Ismail, 58, was appointed as Treasury secretary-general by the current administration on June 13.

He was previously the budget director in the Finance Ministry.