A New York judge on Tuesday temporarily halted the publication of a "tell-all" book by Donald Trump's niece that dubs the US president "the world's most dangerous man."

The temporary restraining order prevents the release of the 240-page book until at least a July 10 court hearing that will see Mary Trump and her publisher, Simon & Schuster, defend its publication.

The president's brother, Robert Trump, had initially asked a court in Queens to issue the temporary restraining order, which was rejected.

He said Mary was violating a non-disclosure agreement she signed in 2001 after the same court settled a contentious fight over the estate of real estate tycoon Fred Trump -- the father of Donald and Robert and of Mary's father Fred Trump Jr, who died in 1981.

The Queens judge said he was not the right jurisdiction to seek an injunction against the book.

The order from Hal Greenwald of the New York Supreme Court now requires Mary and her publisher respond to Robert's lawsuit.

Donald Trump's niece plans to publish a tell-all book about their family
Donald Trump's niece plans to publish a tell-all book about their family AFP / MANDEL NGAN

Mary's attorney vowed to immediately appeal.

"The trial court's temporary restraining order is only temporary but it still is a prior restraint on core political speech that flatly violates the First Amendment," her counsel, Theodore Boutrous, said in a statement.

"This book, which addresses matters of great public concern and importance about a sitting president in an election year, should not be suppressed even for one day."

Charles Harder, Robert's attorney who has also represented the president, said his client was "very pleased" with the order.

In the book, Mary, a 55-year-old clinical psychologist, recounts what she witnessed of the "toxic family" in the home of her grandparents, according her publisher.

The Daily Beast reported earlier this month that the book will reveal that Mary Trump was the crucial source for explosive New York Times reporting on Trump's finances, which suggested the billionaire paid little in tax for decades.

President Trump, like his brother, last week told Axios that Mary's non-disclosure agreement prevents her from revealing family secrets.