The Justice Department has abandoned its effort to claw back profits of a book by former Trump national security adviser John Bolton and closed a grand jury investigation into whether he criminally mishandled classified information without charging him, according to court filings and Bolton’s defense attorney.

In a one-sentence court filing Wednesday, the Justice Department asked a federal judge to dismiss a lawsuit it filed in a failed attempt to block the release last June of Bolton’s White House memoir, “The Room Where It Happened.” The filing indicated each side would pay its own legal fees.

Justice Department officials also notified Bolton’s defense team that it was closing all aspects of his case, his attorney said.

Lead Bolton attorney Charles J. Cooper called the dismissal a complete vindication for the veteran diplomat, repudiating what Bolton said was the Trump White House’s politically motivated attempt to stifle the pre-election publication of his scathingly critical memoir before the 2020 presidential election, using security as a pretext.

“We are very pleased that the Department of Justice has dismissed with prejudice its lawsuit against Ambassador Bolton and has terminated grand jury proceedings,” Cooper said in a statement. “By ending these proceedings without in any way penalizing Ambassador Bolton or limiting his proceeds from the book, the Department of Justice has tacitly acknowledged that President Trump and his White House officials acted illegitimately.”

In an interview, Bolton said he wants to consider what other steps to take in light of what he called Trump and senior Justice Department officials’ abuse of power.

“We believe that many people in the Justice Department, fundamentally from the beginning, thought this was ill-advised. I think the Trump White House lawyers and some of the political lawyers at the Justice Department were doing Trump’s bidding,” Bolton said.

A spokeswoman said the Justice Department declined to comment. A spokesman for Trump did not immediately respond to a request for comment.

Details surfaced in September that a Justice Department criminal probe had reached a grand jury, issuing subpoenas for records, including from Simon & Schuster, Bolton’s publisher.

The memoir recounted Bolton’s 17 months as Trump’s top national security official and painted a withering portrait of Trump as an “erratic” and “stunningly uninformed” leader.

Among other disclosures, the book reported that Trump asked Chinese President Xi Jinping to help him win reelection, that the sitting president attempted to use military aid to pressure Ukraine on political investigations, and that Trump expressed a willingness to halt or obstruct criminal investigations as personal favors to authoritarian foreign leaders.

Bolton in promotional interviews called Trump incompetent and “unfit for office.”

In response, Trump stated that he hoped Bolton would be investigated, that Bolton “broke the law” and should be in jail and have money seized “for disseminating, for profit, highly Classified information.” He also has called Bolton’s memoir “a compilation of lies and made up stories, all intended to make me look bad.”

The Trump administration unsuccessfully sought to block the book’s release in June 2020, saying it contained classified information that was not properly reviewed before publication.

Gen. Paul M. Nakasone, director of the National Security Agency, declared in a court affidavit that a limited portion of the Bolton’s draft manuscript “implicates” information classified at the highest level. He said the “compromise of this information could result in the permanent loss of a valuable [signal intelligence] source and cause irreparable damage to the U.S. [signal intelligence] system.” Such intelligence is derived from electronic systems used by foreign targets, such as communications systems, radars and weapons systems.

U.S. District Judge Royce C. Lamberth rejected the government’s request to block publication after the publisher declared that more than 200,000 copies had already shipped.

But he ruled that Bolton “exposed his country to harm and himself to civil (and potentially criminal) liability” in further litigation. The judge also gave Bolton’s defense the opportunity to probe allegations that Trump or senior aides acted in bad faith to delay or unduly influence classification decisions.

Bolton denied the book contains classified information, cited his cooperation with a lengthy pre-publication review and added that he brought decades of experience working with secret material to the task.

Bolton said Wednesday, “We don’t know what was shown by the White House lawyers, and I don’t think you can exclude the possibility there were misrepresentations made to the court.”

An attorney for the career official who conducted the clearance review agreed, saying White House aides took unprecedented steps to “commandeer” the review and erroneously claimed it spilled secrets to thwart its release. Ellen Knight’s attorney wrote in September that she came forward to warn against the “politicization” of government proceedings, noting for example that Trump appointees halted a response to Bolton’s request to prioritize review of a chapter about Trump’s interactions with Ukraine so it could be made public during his first Senate impeachment trial.

In pre-publication litigation, the government disclosed that national security adviser Robert C. O’Brien, whom Trump appointed to succeed Bolton, ordered an additional review of the book after Knight, a career National Security Council staffer, said he had completed required edits.

An untrained Trump appointee, Michael Ellis, a former aide to Rep. Devin Nunes (R-Calif.), took over the review and wrongly challenged hundreds of passages, leading to the government litigation, Knight said.

Objecting that “a designedly apolitical process had been commandeered by political appointees for a seemingly political purpose,” Knight said several government attorneys agreed in a later debriefing when she speculated that the reason the Justice Department was suing Bolton was “because the most powerful man in the world said that it needed to happen,” Knight attorney Kenneth L. Wainstein wrote.

Bolton questioned whether White House and Justice Department lawyers met their ethical obligations and called their treatment of Knight unconscionable. He said he would try to help GOP candidates who agree with his foreign policy positions and oppose Trump.

“I’m very much committed to try and correct the damage Trump did to the party,” Bolton said.

Knight, a 16-year career federal employee on detail to the NSC from the National Archives and Records Administration, was on track to be hired full time, in keeping with the practice that the senior director for records access remain through presidential transitions to ensure continuity of operations, Wainstein wrote in the letter. He wrote that after 18 hours of meetings with government lawyers, she refused in June to sign a statement concerning the government lawsuit against Bolton and was then told “there is no path forward” for her at the council. Wainstein said Knight returned to NARA in August.

Then-Deputy Assistant Attorney General David M. Morrell in June told the court he knew of no precedent in which high-level officials intervened in classification reviews. However, Morrell added that it was “entirely appropriate” given “an extraordinary set of facts,” in which a former national security adviser detailed ongoing policy matters during the same administration in which he served.

Tom Hamburger contributed to this report.