By Nate Raymond

WORCESTER, Mass. (Reuters) - A federal judge on Wednesday extended until Aug. 31 an order preventing the eviction of hundreds of Puerto Rican families who fled the hurricane-ravaged island in 2017 and have been living in hotels and motels across the United States.

U.S. District Judge Timothy Hillman in Worcester, Massachusetts, issued the order after hearing arguments over whether he should issue a longer-term injunction barring the federal government from cutting off housing assistance to people who were forced to leave their homes because of Hurricane Maria.

The Federal Emergency Management Agency (FEMA) had planned to end the assistance program on June 30. Hillman's decision on Wednesday extended a previously-imposed temporary restraining order that allowed the families to remain in hotels until checkout time on Aug. 7.

Hurricane Maria hit Puerto Rico on Sept. 20 with winds close to 150 miles per hour (240 kph), causing an estimated $90 billion in damage to the already economically struggling U.S. territory.

According to FEMA, 1,041 families displaced by Maria are currently receiving aid under a program in which they were provided a voucher to seek hotel lodging. In total, the Maria assistance program has since its launch helped 7,032 families, the agency said.

Four Puerto Ricans, including one residing in Massachusetts, are pursuing a proposed class action lawsuit, which was filed on June 30 and contends that FEMA's actions would violate their due process rights under the U.S. Constitution.

Their lawsuit contends that FEMA is seeking to prematurely stop providing assistance to Puerto Ricans displaced by Hurricane Maria whose homes remain uninhabitable due to the worst natural disaster to hit the island in a century.

Critics on the island have said in the weeks after the storm that federal agencies responded poorly to the disaster. They argued that President Donald Trump's administration viewed Puerto Ricans as second-class citizens, a claim it denies.

(Reporting by Nate Raymond in Boston; Editing by Bill Berkrot)