A man was trapped for at least three hours after a floor collapsed in a bathroom at a motel with a history of safety and code violations.

One of the man's legs went through the floor Monday and became stuck underneath the bathtub inside the room at the Kings Inn in South Williamsport, borough police chief Rexford Lowmiller said.

The man, who was not identified, was discovered by a family member who called for help, Lowmiller said Tuesday. He was treated at Williamsport Hospital and released.

Mitaz Mahmoud, a clerk at the inn, said Tuesday that the man had returned to the motel and was staying in another room.

There weren't many vacant rooms as of Tuesday, however, because building inspectors shut down the entire upper floor, leaving only 10 first-floor rooms open, Mahmoud said. Seven of those rooms were occupied as of Tuesday, he said.

A bar and restaurant attached to the motel had already been closed on Jan. 25 because of safety and code violations, Lowmiller said. Borough codes officer Jon Dangle said the inn has been cited previously for violations including lack of hot water and mold.

Owners had corrected some problems but were becoming lax, Dangle said.

"There have been quite a number of issues with the place of the last several months," Lowmiller said. "This is just another one on the pile."

Mahmoud said the building's owner, who lives in New York, planned to return to the inn on Wednesday and arrange for any needed repairs.