KITTERY, Maine — A nuclear-powered submarine heavily damaged by a fire set by a shipyard worker three years ago departed Portsmouth Naval Shipyard on Friday for a final journey to the West Coast, where it'll be cut up for scrap.

Shipyard workers completed the inactivation of the former USS Miami, removing equipment and ship systems, before it was towed away by tugboats with assistance from two Navy ships, shipyard spokeswoman Danna Eddy said.

The May 2012 fire, which occurred while the submarine was undergoing an overhaul at the shipyard, turned into an inferno that took more than 100 firefighters half a day to douse. Seven firefighters were hurt.

A former shipyard worker pleaded guilty to setting the fire and is serving a 17-year prison sentence. Prosecutors said the worker suffered from anxiety and set the fire because he wanted to leave work early.

The Navy originally intended to return the Los Angeles-class attack submarine to the fleet after extensive repairs. But it decided to scrap the submarine when estimated repair costs grew to upward of $700 million.

The Navy said farewell to the Miami during a ceremony in March 2014.

Shipyard workers have been busy in the months since then, draining hydraulic fluids and oil and removing spare parts and furnishings, Eddy said. Electrical systems were de-energized, and the submarine's main battery was removed. Temporary ventilation, lighting, power and compressed air services were installed.

The plan for the nuclear fuel was to ship it to a federal repository in Idaho, officials said.

× Fear of missing out? Sign up for the Navy Times Daily News Roundup to receive the top Navy stories every afternoon. Thanks for signing up. By giving us your email, you are opting in to the Navy Times Daily News Roundup.

It's a process that the Navy has conducted on more than 350 nuclear-powered vessels. Navy ships Apache and Navajo will assist in the process of towing the sub to Puget Sound Naval Shipyard in Washington state for dismantling.

While active, the submarine was dispatched on more than a dozen deployments that included clandestine undersea warfare missions and back-to-back deployments in which it fired cruise missiles in Iraq and in Serbia, earning the nickname Big Gun.