A New York court on Thursday rejected an effort by President Trump’s family to block the publication of a book by the president’s niece, Mary L. Trump, who is said to describe the “nightmare of traumas” that led to her uncle being the “world’s most dangerous man.”

However, the effort to block the book is set to continue in a different court.

Judge Peter J. Kelly of Queens County Surrogate’s Court dismissed the effort by President Trump’s brother, Robert, to block publication on grounds that it was filed in an improper jurisdiction and that a family probate dispute had long been settled.

Mary Trump’s lawyer, Theodore Boutrous Jr., said in a statement that the court “has promptly and correctly held that it lacks jurisdiction to grant the Trump family’s baseless request to suppress a book of utmost public importance.” Boutrous said he hoped that ends the matter.

“Democracy thrives on the free exchange of ideas, and neither this court nor any other has authority to violate the Constitution by imposing a prior restraint on core political speech,” Boutrous said.

But Robert Trump’s attorney, Charles J. Harder, said he would refile the petition to the state Supreme Court. In the petition, Robert Trump said Mary Trump had agreed not to publish anything about those involved in the case after agreeing to an unspecified payout in a family inheritance case.

“Robert Trump, Mary Trump and the other family members who settled in 2001, agreed to jurisdiction of future disputes in the Surrogate’s Court of Queens County, New York,” Harder said. “This matter therefore was filed in that court. Today, the Surrogate’s Court ruled that it does not have jurisdiction over the dispute. Therefore, Robert Trump will proceed with filing a new lawsuit in the New York State Supreme Court.”

Mary Trump, 55, is a psychologist. Her book is titled, “Too Much and Never Enough: How My Family Created the World’s Most Dangerous Man.”

Presales of the book, slated for publication on July 28, have soared to the top of bestseller lists on the basis of a description from publisher Simon & Schuster that it will reveal decades of family secrets, including a “nightmare of traumas” that explain the psychology of the man who is now president.

Simon & Schuster said in a statement that it is “confident we will prevail should there be further efforts to stifle this publication.”

The president and his allies have made or threatened numerous efforts to block books by journalists and former staffers, and his administration most recently failed to stop the publication of former national security adviser John Bolton’s highly critical memoir, “The Room Where It Happened,” published Tuesday by Simon & Schuster.

But an effort to stop publication by a member of his family is unprecedented and is bound to bring even more attention to it. In the case of the Bolton book, the contents had already been leaked and volumes printed by the time Trump tried to stop it. In the case of Mary Trump’s book, its contents remain closely guarded by the publisher.