Maine, not New Hampshire, owns the Portsmouth Naval Shipyard, the U.S. Supreme Court ruled Tuesday.

In a 16-page ruling, the court rejected New Hampshire's claim that historical evidence shows the boundary between the states is on the Maine shoreline of the Piscataqua River. New Hampshire acknowledged in a 1977 lobster-fishing dispute that the boundary was the middle of the river, and it cannot change its mind now, Justice Ruth Bader Ginsberg wrote for the court.

A legal doctrine called judicial estoppel "prevents a party from prevailing in one phase of a case on an argument and then relying on a contradictory argument in another phase," the court said, quoting from an earlier case.

Justice David Souter, a New Hampshire native, did not participate in the decision. Souter was New Hampshire's attorney general in the 1970s and endorsed the middle-of-the-river settlement embodied in a consent decree.

In the new case, New Hampshire said it endorsed the 1977 settlement without having performed "a searching inquiry into what that language (middle of the river) meant," the court noted.

"We are unpersuaded, however, that New Hampshire's position in 1977 fairly may be regarded as a product of inadvertence or mistake," the court said.

The shipyard is on Seavey Island between Portsmouth, N.H., and Kittery, Maine, it has long been considered part of Kittery.

Maine collects $5 million a year in state income taxes from roughly 1,300 New Hampshire residents who work at the yard. New Hampshire has no personal income tax.

U.S. Rep. John E. Sununu, R-N.H., called the ruling "a tremendous disappointment" for the New Hampshire workers, who he said are being treated unfairly.

"There's no question that New Hampshire workers at a federal facility shouldn't be assessed Maine income tax," he said.

Portsmouth resident Ruth Griffin, a member of the state's Executive Council, deplored the ruling. Griffin listened to oral arguments last month in Washington.

"The questions from the Supreme Court justices left doubt in my mind that they knew what they were talking about," she said.

As for collecting Maine income tax from New Hampshire workers, she said, "I think they're all wet."