A U.S. District judge ruled Monday night the National Park Service must give protesters in McPherson Square some notice if it moves to evict them, except for in emergency situations, according to a lawyer for an Occupy D.C. protester.

Following a day-long standoff Sunday after protesters erected a 15-foot-tall wood-frame structure in the park, one protester sought a ruling clarifying his rights if the National Park Service decides to enforce a ban on overnight camping.

In an order handed down by Judge James E. Boasberg, the court said the Park Service should provide “24-hour notice to the Court” and protesters “if it intends to enforce its regulations prohibiting camping or sleeping in McPherson Square.”

“Absent such notice or exigent circumstances, the Government will not restrict Plaintiff’s access to the square or his camping or sleeping in the square,” the judge wrote.

Jeffrey Light, an attorney for Occupy protester Brett Henke, said the ruling should ease protesters’ concerns that Park Police might suddenly conduct a raid on McPherson Square, separating protesters from their personal possessions.

“It certainly helps to calm a lot of people down to know there are not going to be any surprises from the Park Police,” said Light, of the National Lawyers Guild. “Things will happen in an orderly way by going to court before people get kicked out, and people will get their day in court.”

In the complaint, Henke sought an injunction preventing Park Police from removing tents from the park without probable cause. In the complaint, Henke says he was separated from some of his medicine during Sunday’s police activity.

After protesters erected their structure Saturday night, Park Police cordoned off about half of the park Sunday as they arrested 31 demonstrators and removed the structure.

“This action seeks to vindicate rights protected by the First and Fourth Amendments to the United States Constitution and is brought pursuant to the inherent authority of the federal judiciary to restrain unlawful acts of the government,” the suit says.

The judge did not rule on the merits of the suit, but he denied the motion for a temporary restraining order. Instead, a second hearing was scheduled for Jan. 31. Light said the judge brokered an agreement between the parties that the Park Police provide notice before an eviction.

A Park Service spokesman was not immediately available to comment. But Light said Park Service attorneys argued during the hearing that they no had no immediate plans to clear McPherson Square but that they wanted the right to move in on the encampment in an emergency.

Under Boasberg’s order, Light said, Park Police will still be able to restrict access to the park in emergencies.

“If there was a knife fight, certainly the government could come in and deal with that,” Light said. “But to remove tents that have been there for two months, that is not an emergency and they could certainly wait 24 hours to have a hearing.”