The Justice Department filed a lawsuit Tuesday asking a federal judge to order former White House national security adviser John Bolton to stop the release of his book, asserting that his much-anticipated memoir contains classified material.

The move sets up a legal showdown between President Trump and the longtime conservative foreign policy hand, who alleges in his book that the president committed “Ukraine-like transgressions” in a number of foreign policy decisions, according to his publisher.

But the Trump administration stopped short of seeking a court order against Bolton’s publisher to stop the distribution of “The Room Where It Happened: A White House Memoir,” which is due to go on sale June 23 and has already been shipped across the country.

Instead, the civil suit, filed in U.S. District Court in Washington, accuses Bolton of breach of contract by violating his nondisclosure agreement and asks the court to order him “to instruct or request his publisher, insofar as he has the authority to do so, to further delay the release date.”

The suit also asks the court to prohibit him from disclosing any information in the book without written permission from the administration and from releasing it in any form, and to order him to notify his publisher that he did not complete the prepublication review process.

In addition, the Justice Department asked the court to order Bolton “to take any and all available steps to retrieve and dispose of any copies of ‘The Room Where it Happened’ that may be in the possession of any third party in a manner acceptable to the United States.”

Finally, it asks the court to follow a step taken in previous cases involving unauthorized disclosures of classified information by former government officials: establishing a trust that would direct any profits from the book to the U.S. Treasury.

Charles Cooper, Bolton’s attorney, said, “We are reviewing the government complaint and will respond in due course.”

Cooper has said that his client’s book does not contain any classified material and that Bolton has worked with the National Security Council since December to vet the manuscript. Bolton’s publisher, Simon & Schuster, has said the former national security adviser spent months doing revisions at the request of the White House.

In a letter sent to the White House on June 10, Cooper wrote that Bolton has no authority to stop the distribution of the book, which he noted had already been printed and shipped around the country, according to a copy attached as an exhibit in the Justice Department suit.

Simon & Schuster said in a statement Tuesday night that the Justice Department action “is nothing more than the latest in a long running series of efforts by the Administration to quash publication of a book it deems unflattering to the President.”

Legal experts said it was notable that the Justice Department did not file a suit against Simon & Schuster, pointing out that courts are averse to preemptively blocking publication of books, particularly those that deal with political speech.

Rather, in going directly after Bolton, the Trump administration appears to be focused on a different strategy, experts said: using financial pressure to discourage him from disclosing sensitive information without government permission.

Jameel Jaffer, executive director of the Knight First Amendment Institute at Columbia University, called the complaint “strategically ambiguous about what relief the government is seeking, and against whom.”

While the government is clearly seeking a court order asking Bolton to block publication of the book, Jaffer noted, “it’s not clear that Bolton is in a position to provide it.”

Stephen Gillers, a First Amendment law expert at New York University, said that the odd language used by the government in its request for court intervention was likely a strategy designed to apply pressure on both the publisher and Bolton.

“The U.S. has no chance of an injunction against the publisher, which did not sign the NDA,” Gillers said. “It wants the publisher to get the court-ordered notice so that, if it publishes anyway, the U.S. will have some basis then to seek civil or criminal sanctions against it.”

Trump hinted Monday that he would seek to stop the release of the book, telling reporters that it was “highly inappropriate” for Bolton to write the memoir.

“I will consider every conversation with me as president highly classified,” he said. “So that would mean that, if he wrote a book and if the book gets out, he’s broken the law and I would think that he would have criminal problems. I hope so.”

“Maybe he’s not telling the truth,” added the president. “He’s been known not to tell the truth, a lot.”

Attorney General William P. Barr concurred on classification, telling reporters at the White House on Monday that “we don’t believe Bolton has gone through the process” required to clear books by government officials on topics of national security.

The Justice Department complaint filed Tuesday said legal action was necessary to keep Bolton “from compromising national security by publishing a book containing classified information—in clear breach of agreements he signed as a condition of his employment and as a condition of gaining access to highly classified information and in clear breach of the trust placed within him by the United States Government.”

However, in his June 10 letter to the White House, Cooper said that an NSC official who reviewed the manuscript signed off on it April 27 after Bolton made extensive edits to protect national security.

In response, John A. Eisenberg, a deputy White House counsel, wrote to Cooper on June 11, “Your client is well aware that his manuscript still contains classified material,” according to a copy provided as an exhibit in the suit.

Eisenberg said he was “shocked and dismayed” to learn that Bolton’s manuscript had been printed and sent to distributors “in brazen disregard of his obligations” under the non-disclosure agreement he had signed with the White House.

The White House did not respond to a request for comment.

The 592-page book is expected to go into detail about Trump’s decision-making process, his warring advisers and the president’s engagement on a range of foreign policy decisions, from Ukraine and Venezuela to North Korea and Iran.

‘‘I am hard-pressed to identify any significant Trump decision during my tenure that wasn’t driven by reelection calculations,’’ Bolton wrote, according a description released Friday by Simon & Schuster.

The veteran GOP foreign policy adviser, who served as Trump’s national security adviser from April 2018 to September 2019, also argues in the book that House Democrats “committed impeachment malpractice” by focusing their inquiry on Ukraine, according to the publisher.

The New York Times reported earlier this year that an early draft said Trump withheld military aid to Ukraine as a way to pressure the country’s newly elected president to launch an inquiry of Democrats, including the activities of former vice president Joe Biden and his son Hunter Biden. That news broke just as the Senate was considering articles of impeachment against the president.

The administration’s effort to block the book is troubling, legal experts said.

“Any effort to enjoin the publication of a book raises serious First Amendment concerns, and those concerns are heightened here because there are credible reports that the White House’s interest is not in protecting national security, but in suppressing criticism of the president,” Jaffer said.

Last week, the White House warned Bolton that his book needed further revision to comply with a review process required of government employees writing about national security and intelligence issues.

“The unauthorized disclosure of classified information could be exploited by a foreign power, thereby causing significant harm to the national security of the United States,” Eisenberg wrote.

Bolton was told that the White House would provide him with a new, redacted manuscript by June 19, four days before the book is to go on sale.

In response, Cooper said his client scrupulously complied with national security vetting requirements.

“Simon & Schuster is fully supportive of Ambassador Bolton’s First Amendment right to tell the story of his time in the Trump White House,” Julia Prosser, vice president and director of publicity for the publishing house, said in a statement last week.

Prosser noted that Bolton took care to make sure the book, which was originally scheduled to be published in March, did not endanger national security.

“In the months leading up to the publication of ‘The Room Where It Happened,’ Bolton worked in cooperation with the National Security Council to incorporate changes to the text that addressed NSC concerns,” she said in a statement. “The final, published version of this book reflects those changes.”

Spencer S. Hsu and Felicia Sonmez contributed to this report.