Treasury Secretary John Fraser will quit the job on July 31 after three-and-a-half-years as Australia's chief economic bureaucrat.

Mr Fraser was appointed to the job by then-prime minister Tony Abbott, serving under previous treasurer Joe Hockey and the incumbent Scott Morrison.

Mr Fraser's pending retirement was announced by Prime Minister Malcolm Turnbull in a media statement.

"In the last three-and-a-half years in the role as Treasury Secretary Mr Fraser has led Treasury to new heights, especially in the areas of corporate and personal income tax reform," Mr Turnbull said.

"He has strongly supported the Government's efforts to help repair the budget.

"He has been a trusted adviser to the Treasurer, ministers and myself on key economic matters.

"On behalf of the Government, I thank him for his service to the Australian community and our economy."

Mr Turnbull said the Governor-General had accepted his recommendation for Mr Fraser to be replaced by Philip Gaetjens.

Mr Gaetjens was the secretary of the New South Wales Treasury between 2011 and 2015, previously serving as a senior executive in the Commonwealth Treasury, the Department of Prime Minister and Cabinet and the South Australian Department of Treasury and Finance.

The Prime Minister noted that Mr Gaetjens recently departed as the chief of staff to Treasurer Scott Morrison, a role that he also held with former treasurer Peter Costello.

Labor hit out at the appointment, accusing the Liberals, and Mr Morrison in particular, of politicising the Treasury.

"Despite this appointment coming on the eve of a general election — when Treasury [with Finance] produces the pre-election economic and fiscal outlook — the Treasurer did not bother to consult with the Opposition," Shadow Treasurer Chris Bowen said in a statement.

"The Treasury is a fine institution that deserves the best people and processes and not the constant politicisation that Scott Morrison has subjected it to."