Not everything that floats is a boat, the Supreme Court ruled Tuesday, even if it is docked at a marina.

Case in point: Fane Lozman’s approximately 60-by-12-foot floating two-story home, which featured French doors and a staircase but no motor or rudder.

The city of Riviera Beach, Fla., trying to evict Lozman, declared it a “vessel” and used federal maritime law to win a judgment against the former Marine. The city eventually bought the floating home when it was being auctioned off to satisfy the judgment and destroyed it.

Lower federal courts upheld the action, adopting a broad definition of a vessel that included most any structure that floats and is capable of transportation.

The Supreme Court, by a 7 to 2 vote, said that was wrong, in an opinion that reads as though Justice Stephen G. Breyer had a good time writing it.

An analysis of the 2011-2012 Supreme Court session, including justice voting patterns and key cases.

“Not every floating structure is a ‘vessel,’ ” he wrote. “To state the obvious, a wooden washtub, a plastic dishpan, a swimming platform on pontoons, a large fishing net, a door taken off its hinges, or Pinocchio (when inside the whale) are not ‘vessels,’ even if they are ‘artificial contrivances’ capable of floating, moving under tow, and incidentally carrying even a fair-sized item or two when they do so.”

The test the court came up with, Breyer acknowledged, is general. A floating residence is not a vessel, he said, “unless a reasonable observer, looking to the home’s physical characteristics and activities, would consider it to be designed to any practical degree for carrying people or things on water.”

The decision was a victory for Lozman, who has had a series of run-ins and legal battles with city officials. But it was also welcome news for commercial establishments that float but are permanently moored, such as riverside casinos.

The American Gaming Association told the justices in a brief that there are 61 floating casinos in six states and said that the establishments should not be forced to defend against lawsuits filed by employees and customers under federal laws meant to protect seamen. The casinos are regulated under state laws.

Lozman bought the “floating home” — a “houseboat” has a means of propulsion, Breyer wrote in explaining the difference — in 2002. He had it towed to several locations, ending up in 2006 in the Riviera Beach city marina.

After unsuccessfully trying to evict Lozman under state laws, the city made its move under admiralty law. A federal district judge and then the U.S. Court of Appeals for the 11th Circuit agreed with the city that the home was covered under federal law that defined a vessel as including “every description of watercraft or other artificial contrivance used, or capable of being used, as a means of transportation on water.”

Seven Supreme Court justices disagreed. “But for the fact that it floats, nothing about Lozman’s home suggests that it was designed to any practical degree to transport persons or things over water,” wrote Breyer, who was joined by Chief Justice John G. Roberts Jr. and Justices Antonin Scalia, Clarence Thomas, Ruth Bader Ginsburg, Samuel A. Alito Jr. and Elena Kagan.

The case will go back to federal district court, where Lozman will have a chance to be compensated for the loss of the home.

Justices Sonia Sotomayor and Anthony M. Kennedy dissented. Sotomayor wrote that the majority’s introduction of what a “reasonable observer” might glean from examining a craft muddies the issue, when what is needed are “clear and predictable legal rules for determining which ships are vessels.”

She agreed that the 11th Circuit’s definition was too broad but said she would have sent the case back to the lower courts for a more careful look at the specifics of the case.

“The little we do know about Lozman’s craft suggests only that it was an unusual structure,” she wrote.

The case was once known as Riviera Beach v. That Certain Unnamed Gray, Two-Story Vessel Approximately Fifty-Seven Feet in Length. At the Supreme Court, it was simply Lozman v. Riviera Beach .