People in Houston are “at risk of being arrested just because they are homeless”, a lawyer with the American Civil Liberties Union said, after a federal judge cleared the city to enforce an ordinance that prohibits the setting up of tents and temporary living quarters in public places.

US district judge Kenneth Hoyt, who had blocked the law while a civil lawsuit is pending in his court, lifted his temporary restraining order on Thursday and denied a request for a preliminary injunction.

“While this court is indeed sympathetic to the impact that enforcement of the encampment ordinance on unsheltered homeless individuals poses,” Hoyt wrote, “the court recognizes the city’s police powers to enact and enforce reasonable legislation that promotes the health, safety and general welfare of all Houston residents.”

The ACLU of Texas is suing the city on behalf of four homeless people, contending the ordinance violates the constitutional protections of homeless people and makes homelessness a crime.

Hoyt disagreed, saying the ordinance “prohibits obstructions that hinder the city from preserving public property for its intended purpose”.

City officials argue the tent cities and encampments, primarily under freeway overpasses, are hazardous to public health and safety.

Mayor Sylvester Turner said he was grateful the judge “has, for now, essentially endorsed the city’s effort to strike a balance between preserving personal freedoms of every Houstonian and eliminating threats to public health that have developed at and near encampments on public property in the center of the city”.

Trisha Trigilio, the ACLU’s lead attorney, said lawyers were considering whether to appeal. To describe the ruling as disappointing “seems like an understatement”, she said.

“Our clients are living in the encampments because they have no place else to go,” she said. “Our clients are now at risk of being arrested just for being homeless.”

If ticketed, people who cannot afford a place to live face fines up to $500, Trigilio said, adding: “It’s not a constructive public policy solution.”

Turner has said the restraining order caused conditions to worsen. One site includes more than 100 tents under a freeway near downtown. It and another site have been the scene of homicides and other crimes.

Residents of nearby neighborhoods have complained about conditions public health officials agree are becoming a hazard because of large amounts of feces and urine on the ground.

The city has cleared out the camps for cleanings but Hoyt’s order, issued in August, did not prevent people from returning and setting up tents, stoves and furniture.

The ordinance is part of a six-point plan the city unveiled earlier this year, including providing more permanent housing and an anti-panhandling campaign. Officials say Houston has about 3,400 homeless people.

The city is proposing to move some of the homeless to a plot of land at a bus depot where they can find security and shelter. No trial date has been set for the lawsuit.