By Nicole Acevedo

Hundreds of Puerto Ricans who have been living in motels and hotels on the mainland as part of FEMA’s temporary housing aid after Hurricane Maria have to check out on Sept. 14, a federal judge ruled on Thursday.

Although the judge, Timothy Hillman of U.S. District Court in Massachusetts, decided to end FEMA’s Transitional Sheltering Assistance (TSA) program in two weeks, he strongly urged the parties to work together to find temporary housing for the families before then.

The decision came down after LatinoJustice PRLDEF, a national civil rights group, filed a lawsuit on June 30 seeking a restraining order to stop FEMA from ending the program, which the group said would lead to the families' evictions. When the lawsuit was initially filed, 1,744 Puerto Rican adults and children were in the program, an attorney involved in the suit said.

“We were basically arguing, don’t evict them until you can assure that they have a place to go,” Natasha Lycia Ora Bannan, associate counsel of LatinoJustice PRLDEF, told NBC News. “FEMA has a number of programs they could have activated in order to do this, but they decided not to.”

At that time of the suit filing, a different judge introduced a temporary restraining order that extended the program to July 30; this was followed by an extension by Hillman until Aug. 31.

In Thursday's ruling, Hillman extended the restraining order to Sept. 13 in order to allow some time for families to relocate.

“The judge’s recommendation was based on what his conscience dictated to him,” said Lycia Ora Bannan in regards to Hillman’s decision. “He felt constrained by law to prescribe an extension, but morally compelled to do so.”

FEMA's TSA program housed Puerto Rican hurricane survivors for nearly 11 months, amid multiple deadline extensions and court interventions. During other disasters, survivors participated in the TSA program for at least a year and a half — even though officials have said that the program normally lasts 30 days.

For Lycia Ora Bannan, the court essentially recognized that FEMA has a lot of discretion in deciding how to allocate resources on a case by case basis.

“This is representative of this administration’s priorities on how they respond to disasters,” added Lycia Ora Bannan.

On Wednesday, President Donald Trump prided his administration for doing “a fantastic job in Puerto Rico.”

“Puerto Rico I would say was, by far, the most difficult of the group and you know right now, FEMA and all of the people that worked so hard there, they were very brave and they have done some job,” Trump said. “We have put billions and billions of dollars into Puerto Rico and it was a very tough one.”

Although Judge Hillman recommended that FEMA and plaintiffs, in this case Puerto Rican hurricane evacuees, work together to assure that families have a place to go in two weeks, nothing in his decision obligates FEMA to do so.

“The only thing that can help now is advocacy,” said Lycia Ora Bannan. “The ball is in FEMA’s court. They have a final chance to listen to the evacuees, to advocates and do things right before the 13th.”

According to a FEMA spokesperson, the agency is "notifying potential hotels that the program has been extended to comply with the court’s order; however, beyond the court-ordered date, there will be no further extensions of the TSA program."

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.