A New York state judge has temporarily blocked the publication of President Trump's niece Mary's new tell-all book, pending the outcome of a hearing set to take place next month.

After a judge in Queens County dismissed a previous lawsuit for being filed in the wrong forum, the president's brother Robert Trump filed a new complaint in New York Supreme Court in Dutchess County, requesting a preliminary injunction and temporary restraining order to prevent the book from coming out. Judge Hal Greenwald scheduled a hearing on the matter for July 10, but granted a temporary injunction on Tuesday to keep the book on hold until then.

PRESIDENT TRUMP'S BROTHER TRYING TO STOP MARY TRUMP'S FAMILY TELL-ALL BOOK 

The judge's order said that the July 10 hearing will be for Mary Trump and publishers Simon & Schuster, Inc. to argue why the book should not be kept under wraps for the duration of the case.

The lawsuit states that when Trump's father Fred Trump died in 1999, there had been objections over the will. As part of a settlement agreement, the complaint says, the family members -- including Mary Trump -- could not publish any accounts of the litigation that had ensued or their relationships with each other.

Courtesy Simon and Schuster

The complaint claims that the only exception that would allow Mary Trump to reveal such information would be if the president, Robert Trump, and their sister, Judge Maryanne Trump Barry consented.

On June 15, Mary Trump announced her upcoming book, “Too Much and Never Enough: How My Family Created the World’s Most Dangerous Man.” The book is scheduled to be published by Simon & Schuster on July 28, and bears a description saying she "shines a bright light on the dark history of their family in order to explain how her uncle became the man who now threatens the world’s health, economic security, and social fabric."

CLICK HERE TO GET THE FOX NEWS APP

The lawsuit claims that under the terms of the family members' agreement regarding Fred Trump's will, in the event she violates the agreement Mary Trump consents to an injunction.

The lawsuit seeks a permanent injunction to prevent the book's publication, a declaration from the court that publication would be in violation of the agreement, as well as unspecified damages and litigation costs.

Fox News' Marta Dhanis contributed to this report.