A federal judge on Friday heard arguments on a request by the Justice Department to block the publication of former national security adviser John Bolton’s memoir over concerns it contains classified information -- but the judge warned “the horse ... seems to be out of the barn,” as copies have already been distributed.

“It certainly looks difficult to me over what I can do about all these books all over the country,” Judge Royce Lamberth said.

BOLTON CLAIMS TRUMP SAID REPORTERS 'SHOULD BE EXECUTED' REQUESTED DOJ SEEK JAIL TIME

The Justice Department was seeking an emergency injunction and a temporary restraining order preventing the release of "The Room Where It Happened" on June 23, saying Bolton had deliberately bypassed the necessary classification review process that he had agreed to.

“In exchange for money, he has broken that promise,” said David Morrell, deputy assistant attorney general, who described Bolton as a “disgruntled” author. “The obligation lies on him to bring his book in line with the contractual obligations he assumed.”

The book includes a number of damning claims about President Trump’s conduct in office, including that Trump pleaded with Chinese President Xi Jinping to help him win reelection, and that he said journalists should be “executed.”

Bolton wrote that after the latter comment, “This led to one of Trump’s favorite legal gambits, namely, that the Justice Department arrest the reporters, force them to serve time in jail, and then demand they disclose their sources. Only then would the leaks stop.”

GIULIANI BLASTS BOLTON AS A 'TOTAL BACKSTABBER,' AMID MEMOIR CLAIMS

After Lambert on Friday suggested it may be too late to clamp down on the book's contents, the Department of Justice said that the government still had an interest in stemming the flow of copies of the text, and noted that an injunction would stop further copies being distributed as well as audiobooks and other electronic copies.

BOLTON MEMOIR DISCUSSES POSSIBILITY OF REPLACING PENCE, 'COOL' VENEZUELA INVASION, AND MORE

The judge gave no initial indication whether he would rule from the bench on the government’s request for relief, and a ruling could come as late as Monday.

In response, Bolton’s team said the government was trying to gag him from revealing embarrassing facts about the president’s conduct in office. Bolton was with his lawyers listening in on the hearing, but Bolton was not expected to speak. The court hearing was conducted by teleconference, with all participants working remotely.

His team pointed to images of reporters wielding the book already and reading from it, and also said that Bolton went to great efforts to make sure no classified information was in the book.

“The speech has been spoken, it cannot be unspoke,” his attorney Charles Cooper told the judge.

He went on to accuse the Trump administration of not engaging in a judicial process, but “theater” as it was urging the judge to order Bolton to do something he is unable to do.

“It’s theater, it’s to use your courtroom as a stage and to enlist you as a player as the government uses the rhetoric, the very incendiary names ... against my client, Ambassador Bolton, because at the end of the day, there is nothing Ambassador Bolton can do,” Cooper said.

CLICK HERE TO GET THE FOX NEWS APP

But the judge said Bolton didn’t receive “written authorization” to publish the book from the National Security Council. Cooper responded that the government signed off on publication because in one email Bolton was told that the manuscript, in its latest form, did not contain classified information -- and that the form in question does not expressly say Bolton would have to wait for written permission.

But the Justice Department claimed Bolton received an email that instructed him that the pre-publication process was not completed.

"Who let the horse out of the barn? Mr. Bolton," Morrell said.

The president slammed the memoir as “pure fiction” on Thursday and said his former national security adviser is “trying to get even” after he fired him from his post last year.

“Bolton’s book, which is getting terrible reviews, is a compilation of lies and made up stories, all intended to make me look bad,” Trump tweeted. “Many of the ridiculous statements he attributes to me were never made, pure fiction.”

Fox News' Brooke Singman and Jake Gibson contributed to this report.