KITTERY, Maine (AP) — The nation's four public shipyards from Maine to Hawaii are each more than a century old and showing their age. The Government Accountability Office said in a report that all of them need substantial improvements to keep up on the repair and overhaul ships.

At Portsmouth Naval Shipyard, the structures are so old that few of those improvements can move forward without taking into account historic preservation.

"We are over 217 years old," said Capt. David Hunt, the shipyard's commanding officer. "It's not as easy just bulldozing buildings and building anew."

The report by the congressional watchdog last month found the Navy's aging public shipyards are failing to fully meet the military's needs. It will take nearly 20 years to catch up on maintenance and modernization projects at the four shipyards, Norfolk Naval Shipyard in Virginia, Puget Sound Naval Shipyard in Washington state and Pearl Harbor Navy Shipyard in Hawaii, in addition to Portsmouth, the GAO said.

Meanwhile, the cost of the backlogged shipyard projects has grown 41 percent to an estimated $4.86 billion over five years, the GAO said.

The report found that shipyard equipment is aging beyond the expected life service, and that each shipyard has had to develop workaround solutions for aging dry docks.

None of that comes as a surprise to the Navy, which agrees that infrastructure improvements to the shipyards are needed to speed up overhaul and repair projects on ships, said William Couch, spokesman for the Naval Sea Systems Command, which oversees the shipyards.

A Navy engineering and design study launched this summer aimed at making all of the shipyards more efficient will be completed in the coming year, he said.

At Portsmouth, on an island overlooking the Atlantic Ocean, the nation's oldest continually operated public shipyard dates to 1800 — and the golden age of sail.

There's plenty of history: The shipyard commander's home was built for Commodore Isaac Hull, skipper of the USS Constitution. The sail loft, clock tower and other structures date to the 1800s. The shuttered Navy prison looks like a turreted castle.

The shipyard went so far as to redesign a parking garage to spare an ox stable designed by the architect responsible for Boston's Quincy Market.

All of the history coexists harmoniously, for the most part, with the latest technology and nuclear-powered submarines.

"It's really a remarkable example of how the Navy has developed a modern-day shipyard using a mix of historic buildings and facilities," said Kirk Mohney, Maine's historic preservation officer, who's consulted on major projects. "They have buildings there that were constructed when sailing vessels ruled the seas. Now they're serving the most technically sophisticated vessels in the world."

Preserving the past at a place that's on the National Register of Historic Places creates some additional hurdles, and costs. For example, slate and copper roofs have to be replaced with the same materials, instead of cheaper alternatives.

But it hasn't stopped the Navy from pressing ahead with improvements.

Over the past couple of years, the Navy has overhauled buildings used for storage, precision welding and administrative and maintenance offices, Hunt said. Work is currently underway on utility upgrades for a new lock system to make the shipyard less dependent on tides, he added. Funding is in place for overhauling a pipefitting shop, and a consolidated blast and paint facility.

The biggest challenge, the shipyard commander said, is moving forward with modernization projects without allowing submarine work to fall behind schedule.

Employees have become accustomed to keeping up the pace while working around the construction projects, said Mark Vigliotta, president of Metal Trades Council.

"We're busy. We've got boats all over the place," he said. "It's a challenge but we're getting the work done."