WASHINGTON — The Justice Department has withdrawn a lawsuit it brought in October against a onetime friend and aide to Melania Trump over her book, one of several cases in which the Trump administration went after former allies who wrote critical memoirs.

The Biden administration requested Monday to dismiss the case against the friend, Stephanie Winston Wolkoff, which Judge Colleen Kollar-Kotelly of the U.S. District Court for the District of Columbia ordered. That brought to an abrupt end a lawsuit whose filing had prompted accusations that Trump administration officials were abusing their power over the machinery of federal law enforcement to enact retribution.

Wolkoff's book, "Melania and Me: The Rise and Fall of My Friendship with the First Lady," depicted the then-first lady as selfish and shallow. The book contains no classified information, but the Justice Department accused Wolkoff of violating a nondisclosure agreement.

A department official said its new leadership had evaluated the case and concluded that ending it was in the best interests of the United States based on the facts and the law.

"We are very pleased that the Department of Justice has dismissed this lawsuit," Lorin L. Reisner, a lawyer for Wolkoff, said in a statement.

The Trump administration used the Justice Department to go after several onetime members of the Trump circle who wrote harsh tell-alls.

In 2018, the day after it became public that former Trump aide Omarosa Manigault Newman had written an unflattering book, the White House asked the department to open an investigation into a paperwork dispute that led to a government lawsuit against her. Her lawyer filed a motion for summary judgment last week.

In June, the department asked a judge to issue an extraordinary order requiring John Bolton, Trump's former national security adviser, to pull his already printed memoir, which presents a negative account of Trump. The judge refused to grant that order but is still weighing the department's request to seize Bolton's $2 million advance in a dispute over the prepublication review process.

In July, a judge ruled that department officials had engaged in retaliation against Michael Cohen, Trump's former personal lawyer, who was about to publish "Disloyal: A Memoir," which portrays the president as a mafia-like figure. Cohen was serving a prison sentence at home because of the pandemic, but officials had ordered him returned to prison when he refused their demand that he sign an agreement not to publish the book.