PORTLAND, Maine (AP) — Navy investigators have determined that a civilian laborer set a fire that caused $400 million in damage to a nuclear-powered submarine because he had anxiety and wanted to get out of work early.

Casey James Fury of Portsmouth, N.H., faces up to life in prison if convicted of two counts of arson in the fire aboard the USS Miami attack submarine while it was in dry dock May 23 and a second blaze outside the sub on June 16.

The 24-year-old Casey was taking medications for anxiety and depression and told investigators he set the fires so he could get out of work, according a seven-page affidavit filed Monday in U.S. District Court in Portland.

Fury made his first court appearance Monday afternoon but did not enter a plea.

Magistrate Judge John Rich III scheduled a combined detention and probable cause hearing for next month. The U.S. attorney's office has filed a motion asking that Fury be held without bail.

Fury's federal public defender, David Beneman, did not speak in court and earlier in the day declined to comment to The Associated Press.

People who appeared to be family members attended the hearing but also declined to comment.

The Miami was in dry dock at Portsmouth Naval Shipyard in Kittery, Maine, for an overhaul when the fire damaged the torpedo room and command area inside the forward compartment. It took more than 12 hours to extinguish.

A second fire was reported June 16 on the dry dock cradle on which the Miami rests, but there was no damage and no injuries.

Fury, who was working on the sub as a painter and sandblaster, initially denied starting the fires but eventually acknowledged his involvement, the affidavit states.

He admitted setting the May 23 fire, which caused an estimated $400 million in damage, while taking a lie-detector test and being told by the examiner he wasn't being truthful.

Fury told Timothy Bailey, an agent for the Naval Criminal Investigative Service, that "his anxiety started getting really bad," so he grabbed his cigarettes and a lighter, walked up to a bunk room and set fire to some rags on the top bunk.

Story continues

The Navy originally said the fire started when an industrial vacuum cleaner sucked up a heat source that ignited debris inside.

Fury said he set the second fire after getting anxious over a text-message exchange with an ex-girlfriend about a man she had started seeing, according to the affidavit. He wanted to leave work early, so he took some alcohol wipes and set them on fire outside the submarine.

Fury said he initially lied about setting the fires "because he was scared and because everything was blurry to him and his memory was impacted due to his anxiety and the medication he was taking at the time," according to the affidavit.

Fury told NCIS agent Jeremy Gauthier that he was taking three medications for anxiety, depression and sleep, and a fourth for allergies. He checked himself into an in-patient mental health facility on June 21 and checked himself out two days later, the affidavit reads.

If convicted of either charge, Fury could face life imprisonment and a fine of up to $250,000 and be ordered to pay restitution, officials said.