PORTLAND — The shipyard worker accused of starting the fire that did $400 million in damage to a Navy nuclear submarine made his first court appearance this afternoon.

With family members in the gallery, some of them tearful, U.S. District Court Judge John Rich III told Casey James Fury what to expect over the next week and what his rights are. Fury was not asked to enter a plea.

Fury was arrested Friday night at the shipyard and charged by the Naval Criminal Investigative Service with two counts of arson for allegedly setting the fire May 23 that destroyed large parts of the USS Miami and a smaller one outside the sub June 16.

Fury was brought to federal court in Portland from the Cumberland County Jail. He appeared in court dressed in an orange jumpsuit, his hands cuffed behind him.

In a sign of the case’s significance, U.S. Attorney Thomas Delahanty II sat at the prosecutor’s table during today’s initial appearance along with Assistant U.S. Attorney Darcie McElwee and indicated afterward he will be personally involved in the prosecution.

Fury has no criminal record in Maine and Portsmouth police say he has never been arrested there, his home town.

Fury is a civilian employee at the Portsmouth Naval Shipyard. Investigators with the Naval Criminal Investigative Service filed papers in U.S. District Court in Portland today charging the 24-year-old with two counts of arson. Fury, a painter and sandblaster, had been working in the areas where both fires started.

Fury initially denied any involvement in the fires, but later admitted setting the small fire June 16 outside the submarine which was quickly extinguished. He said he started that fire after becoming anxious over a texting exchange with his former girlfriend and that he wanted to leave work, the court papers said.

During a polygraph exam, Fury also admitted to setting the May 23 fire by igniting rags in a state room, the court papers say.

Fury had been working to strip paint from the forward area of the submarine just before the fire broke out there, the court papers say. Fury admitted to starting the fire using rags.

The fire burned for 10 hours before shipyard firefighters and fire departments from three states were able to bring it under control. Nobody died but there were minor injuries.

The Navy is in the process of determining whether to repair the submarine or scrap it.

Fury said he was suffering from anxiety the night he set the fire, a condition for which he takes several medications. He also takes medication for depression and insomnia. A few days after the June fire, Fury checked himself in to an in-patient mental health hospital for two days.

The USS Miami is a Los Angeles-class attack submarine that cost $900 million to build, was commissioned in 1990 and was in the Kittery shipyard for an overhaul to extend its lifespan.

Investigators initially said they believed that smoldering material had been sucked into a vacuum cleaner where it eventually ignited.

If convicted, Fury could face life in prison and be ordered to pay restitution, according to a statement by the U.S. Attorney for the District of Maine, Thomas Delahanty II.

Fury is scheduled to appear in U.S. District Court in Portland later today.

A woman answering the telephone at his home in New Hampshire said she did not want to talk to the media.

Rep. Chellie Pingree, D-First District, issued a statement today saying the fire is the work of an isolated individual and should not reflect poorly on the workers at the shipyard.

“These incidents have really shaken the shipyard, so I hope this gives some closure as the workers fully focus on repairing the U.S.S. Miami,” Pingree said. “I hope we can find justice to punish actions that needlessly put lives at stake and would have led to an even more serious disaster and loss of life if not for the courageous, quick reaction of those at the shipyard.”