KITTERY — The Navy is trying for a third time to let the private sector redevelop Portsmouth Naval Shipyard’s shuttered prison, a fortress-like structure that has priceless views of the Atlantic Ocean but needs millions of dollars of repairs.

The prison, located on Seavey Island in the Piscataqua River that separates Maine and New Hampshire, features medieval architecture with turrets that give it the appearance of a castle. The earliest part of the structure dates back 106 years.

The Navy told The Associated Press it issued a notice announcing the leasing opportunity for up to 50 years for private and public sector developers. Details will be made available to interested parties at a conference next month.

More than 80,000 inmates spent time in the prison, which was known as the Navy Brig, before it closed in 1974. Since then, it has fallen into disrepair.

Outside, shrubbery is overgrown and windows are boarded up. Inside, floors are buckled, pipes are broken and electrical fixtures dangle. In addition to overhauling the building, developers would be repair for costly environmental abatement of problems including asbestos and lead paint.

The first time the Navy tried to redevelop the prison was in the late 1990s, when it signed a lease with New Hampshire developer Joseph Sawtelle to transform it into premium office space. The project fell through when Sawtelle died in 2000.

The Navy tried again in 2008 but abandoned the effort in 2009.

The Navy would have to approve the type of development since there are security concerns. The prison is located on an active-duty Navy shipyard that overhauls nuclear submarines.