Solicitor General Noel Francisco, the head lawyer for the federal government who has been at the forefront of defending the Trump administration's legal positions, announced on Wednesday he would leave his post in early July.

The solicitor general is a powerful position, one previously held by Supreme Court Justice Elena Kagan, failed Supreme Court nominee Robert Bork and late Supreme Court Justice Thurgood Marshall. In a press release from the Department of Justice (DOJ), Francisco said he was "grateful" for his time at the department, which included victories in significant Supreme Court cases.

"It has been the honor of my professional career to serve as the Solicitor General of the United States,” he said. “Representing the United States before the Supreme Court is one of the greatest jobs in the law and an opportunity for which I am deeply grateful. I am proud of the significant success the Office of Solicitor General has had in advancing the rule of law in our great nation alongside the dedicated men and women at the Department of Justice — some of the finest lawyers I have known."

Solicitor General Noel Francisco announced Wednesday he is leavind the DOJ in early July. (DOJ/Official)

Solicitor General Noel Francisco announced Wednesday he is leavind the DOJ in early July. (DOJ/Official)

JUDGES APPEAR SKEPTICAL OF DOJ MOVE TO DISMISS FLYNN CASE, AS HIS LAWYER ALLEGES 'GOVERNMENT MISCONDUCT'

Some of the top Trump administration victories Francisco was involved in, either representing the U.S. as a direct party in the case or as an interested third party, included Supreme Court litigation over the president's travel ban, a landmark case that ruled mandatory membership fees for public unions are unconstitutional and a case that overruled a Colorado decision to require a Christian baker to make a cake for a gay wedding.

He was also involved in his fair share of legal losses, like the Trump administration's eventually futile effort to add a citizenship question to the 2020 Census.

One ongoing case Francisco weighed in on was the decision by D.C. District Judge Emmet Sullivan to keep the case against former Trump National Security Adviser Michael Flynn alive despite a DOJ motion to drop the prosecution.

CLICK HERE TO GET THE FOX NEWS APP

Attorney General William Barr praised Francisco in a statement Wednesday.

“Arguing before the Court 17 times on behalf of the federal government, he has been a principled and persuasive advocate on issues ranging from the separation of powers to religious liberty to vigorous enforcement of federal immigration law," Barr said of Francisco. "His skilled advocacy has been instrumental to historic victories on behalf of the president’s national security authority, the free speech rights of public employees, and property owners’ access to federal courts, among many other significant accomplishments."

Francisco was appointed to his post during the president's first year in office, and also has been involved in efforts to curb nationwide injunctions from lower federal courts -- actions that have been a thorn in the side of the Trump administration as it has sought to implement some of its more controversial policies.