More on Miami:

Federal authorities on Monday charged a Portsmouth, N.H., man with "willfully and maliciously" setting the devastating May 23 fire onboard the attack submarine Miami at the Portsmouth Naval Shipyard in Maine.

Casey James Fury, a 24-year-old shipyard worker, admitted to twice setting fire to the sub and was set to appear later in the day in U.S. District Court in Portland, Maine, on two counts of arson, according to the court docket.

The May 23 fire raged out of control for hours, causing $400 million in damages. The Navy is now weighing whether to save the Los Angeles-class boat.

Fury admitted to setting fire to the docked sub twice, on both May 23 and June 16, when a smaller fire broke out below the sub on the drydock cradle, according to the criminal complaint filed Monday. That fire had been extinguished with little to no damages. Investigators determined the source of the fire had been alcohol wipes and began questioning Fury not long after.

After denying involvement in the June 16 fire, Fury acknowledged starting the fire during a July 18 interview with Naval Criminal Investigative Service agent Jeremy Gauthier, according to court documents. That day, Fury said he had been texting his ex-girlfriend, attempting to convince her to stop seeing another guy.

"Fury explained that he became anxious over the text conversation with his ex-girlfriend and wanted to leave work," Gauthier said in an affidavit. "At around 6:30, he started pacing in the area of the [Main Ballast Tanks] and eventually walked aft toward a cut out in the hull near the back of the boat. His mind was racing."

Fury grabbed some alcohol wipes, setting them on wood in the dry dock cradle. He ignited the wipes with a lighter and walked back to his work area, when the fire alarm sounded and the workers left the boat. The flames were put out before they reached 18 inches high.

On July 19, Fury sat down with NCIS for a polygraph test. Fury denied involvement in the May 23 fire at first. Timothy Bailey, the NCIS special agent administering the test, told Fury he was lying. At this point, Fury admitted he'd set the fire.

On May 23, Fury had been needle-gunning in the torpedo room. After an hour and a half of work, Fury, who takes medications for anxiety, felt himself growing nervous. He left the torpedo room with his lighter and cigarette. He walked up a ladder to the mid level and entered a stateroom. Rags and a small vacuum rested on top bunk in the room.

"He set the aforementioned rags on fire with a Bic lighter and after seeing flames approximately two inches high on the rags, he departed the state room, went to the torpedo room and returned to needle-gunning," the complaint said.

Fury has been arrested, a development first reported by the Seacoast Online, a local news site in New Hampshire.