A lack of respect and a string of attacks have driven Solicitor-General Justin Gleeson from his position.

It marks a disturbing series of firsts in Australian history, with a new level of acrimony between the attorney-general and solicitor-general so badly damaging trust and confidence one of the top legal officers had to resign.

It is the first such resignation in the 100-year history of the federal solicitor-general.

“The best interests of the Commonwealth can be served only when its first and second Law Officers enjoy each other's complete trust and confidence within a mutually respectful relationship,” Mr Gleeson wrote in his terse letter to Attorney General George Brandis.

“When such a relationship is irretrievably broken, as is the case here, and each Law Officer holds a term of office established by the Constitution or statute which will not expire in the near future, there must be some resolution to the impasse.

“Noting that you hold office through the will of the people and are responsible to Parliament, whereas my commission rests on a decision of the Governor-General on advice under a statute, I have determined that I will take the necessary steps to resolve the impasse.”

Senator Brandis and Mr Gleeson had been engaged in a verbal battle over the independence of the Solicitor-General's office, after the Attorney-General prohibited other members of the executive (and even the governor-general) from consulting the Solicitor-General without Senator Brandis’ prior approval.

Mr Gleeson said Senator Brandis had tied his hands, interfering with his work and with his vital role as a legal authority separate to the government.

Mr Gleeson said it was just the latest in a string of moves to silence him, adding to the insult of not been fully consulted on major constitutional questions, including on same sex marriage and Citizenship Laws.

Sentor Brandis had assured parliament that Mr Gleeson was consulted on key points, and that the laws would survive a High Court challenge.

Central to the Coalition’s attack on Mr Gleeson’s credibility was that he spoke to shadow attorney-general Mark Dreyfus during the Caretaker period of the federal election on matters to do with the makeup of the Senate earlier this month.

In his letter, Mr Gleeson still refused to back down.

“I make it perfectly plain that my motivation is solely to further the best interests of the Commonwealth by enabling the restoration of a functional working relationship between the first and second Law Officers,” he wrote.

“My decision does not amount to a withdrawal of any position I have taken in relation to matters of controversy between us, including before the Senate Legal and Constitutional Affairs References Committee. I trust that it will in fact better enable the Parliament to make an objective consideration of the issues I have raised undistracted by personalities.

“For the avoidance of any doubt, I also make perfectly plain that I reject absolutely each and every attack and insinuation that has been made in recent times upon me personally, or upon my office, by Government members of Parliament, including you, in Senate Committee processes. Equally, my decision is unrelated to any finding the Senate Committee may make in favour of or adverse to any person.”

Senator Brandis is now tasked with identifying and recommending a suitable replacement for Mr Gleeson, meaning the search is on for a Solicitor-General that will allow the Coalition to make incursions on the role with few complaints.

Mr Dreyfus has weighed in, saying Mr Gleeson's resignation was “a direct result of the Attorney-General's disgraceful treatment of Mr Gleeson and his office”.

“It is not Mr Gleeson who should have resigned today - it is Senator Brandis,” Mr Dreyfus said.

“From the issuing of the Legal Services Direction of 4 May, which so limited Mr Gleeson's ability to do his job, Senator Brandis has acted shamefully. He has lied to Parliament in an attempt to cover up his power-grab, he has refused to acknowledge his wrongdoing, and he has pushed Mr Gleeson out of office to save his own skin.

“Since Senator Brandis's move to destroy the independence of the office of Solicitor-General came to light, Mr Gleeson has conducted himself with dignity and respect at every turn.”

Law Council President Stuart Clark said it was a loss.

“The Office of the Solicitor-General plays a key role in assisting Government, Ministers and agencies to discharge their responsibilities and observe the rule of law,” Mr Clark told Fairfax reporters.

“It is critical that the legal advice which the Solicitor-General provides to Government Ministers and their agencies is frank, fearless and independent.

“Maintaining the independence of that office ensures Executive decision-making is conducted within the confines of the law and the powers conferred upon the Executive by the Parliament.”

Former Solicitor-General Dr David Bennett, QC, who served alongside to three Attorney-Generals, said it was playing out as it should.

“Two things I have learnt in 50 years at the bar are first when 2 people however honest and however well meaning describe the conversation they had their descriptions will invariably differ.

“So there is nothing surprising in two people of good will have two different conversations.

“Once people have disagreement about something there is a strong tendency for the dispute to escalate to higher and higher levels and that is what seems to have happened in this case.

“I find it impossible to apply any criticism to either the Attorney-General or the Solicitor-General in relation to what has occurred.

“The fact these things have occurred does not mean the end of justice in Australia or any of the other exaggerated descriptions.”