The floating dormitory has set sail.

Officials at St. Mary’s College of Maryland announced Monday that the Sea Voyager, a 286-foot cruise ship that served as an impromptu residence hall for 240 students, had returned to sea.

So ends a unique experiment in waterfront living. Students at Maryland’s public liberal arts school spent nearly two months housed in cabins on the idle ship, as college leaders repaired their mold-sullied dormitories on land.

Students moved out of their cabins last week. The boat left its dock at Historic St. Mary’s City on Sunday. When students return to campus next month, they will reclaim their old rooms in residence halls.

The school’s unusual solution to its housing crisis drew heavy publicity and added to the mystique of its riverfront campus, a boating mecca.

Students chafed at their cramped rooms. But that drove them into the lavish common areas.

“And so that meant they got to know each other a lot better,” said Joseph Urgo, the school’s president.

The ship was clearly “not a long-term solution,” Urgo said. There was no electrical connection, so the craft ran on generator power — and there was no easy way to remove solid waste from the vessel.

Students gave cruise-ship life mixed reviews. Some quipped that the walls were too thin, and safety regulations dictated that no more than 28 guests could board the vessel at one time.

Some cabins had no windows. But Julia Gardner, 19, a sophomore, had a daily view of sunrise on the St. Mary’s River.

“I just woke up every day with a smile on my face,” she said.