WASHINGTON — Investigators have identified the Navy sailor accused of starting a fire that engulfed the warship Bonhomme Richard and burned for days at a Navy base in San Diego last year.

The sailor, Ryan Sawyer Mays, 20, joined the service in May 2019 and holds the rank of seaman apprentice, according to Navy records. The Navy formally charged Seaman Mays with aggravated arson and hazarding a vessel last month but declined to provide additional details until federal search warrants were unsealed by a federal court in San Diego on Tuesday.

Documents filed by the Naval Criminal Investigative Service describe a sailor who “hated” the Navy after being sent to a warship following a brief stint as a SEAL trainee in late 2019.

Seaman Mays quit the difficult six-month initial SEAL training course in Coronado, Calif., after just five days, according to the filing.

The fire, one of the worst to engulf an American warship outside combat, rendered the ship inoperative while it was pierside at the base. More than 400 sailors from 16 nearby ships fought the blaze, which reached temperatures of 1,000 degrees and took four days to extinguish.

A lawyer representing Seaman Mays said his client had “maintained his innocence throughout this entire ordeal.”

“He’s presumed innocent, and we look forward for the opportunity to review the evidence and presenting a case on his behalf,” the lawyer, Gary S. Barthel, said in an interview on Wednesday.

Seaman Mays, whose identity was reported earlier by The Daily Beast, was confined in a Navy brig from late August to approximately mid-October 2020 and then released, according to Mr. Barthel. It is unclear why the Navy freed Seaman Mays months before he was formally charged.

After his release from the brig, Seaman Mays reported to the staff of Amphibious Squadron 5 in San Diego, where he is currently assigned.

“He’s expected to perform his duties as he would any other day of the week as any other sailor would,” Mr. Barthel said of his client. “There are no restrictions on his movement.”

Mr. Barthel said his client voluntarily quit the SEAL program, and hopes to re-enter training in the future.

“I think he’d like to go back if given the opportunity, if he meets all the other qualifications,” Mr. Barthel said.

A spokesman for the Naval Special Warfare Command in Coronado, which oversees SEAL training, could not immediately confirm the details described by N.C.I.S.

Navy records show that Seaman Mays left the Naval Special Warfare training center on March 6, 2020, and reported to the Bonhomme Richard on March 23.

The N.C.I.S. report said that the Bonhomme Richard’s command master chief — the ship’s senior-most enlisted sailor and a top adviser to the commanding officer — described Seaman Mays as “a person who showed disdain towards authority and the U.S. Navy.” The report further noted that “the morale and behavior of sailors who had aspired to become a SEAL, and then find themselves serving in a more traditional role on a Navy ship, are frequently very challenging.”

Seaman Mays was assigned to the Bonhomme Richard’s Deck Division, which is responsible for maintaining the physical condition of the ship — a job often involving manual labor such as removing rust and painting.

The warship was undergoing an extended maintenance period and was moored when the blaze broke out on a Sunday morning, when fewer than 200 sailors were aboard. The unsealed documents said that Seaman Mays was on duty aboard the ship that day.

Navy officials deemed the 800-foot-long amphibious warship a total loss after repair estimates rose to more than $3 billion. The ship was decommissioned on April 14, and towed through the Panama Canal. It will be cut into scrap metal in Texas.

According to the N.C.I.S., a witness identified Seaman Mays as the only person who entered a vehicle storage area deep within the ship the morning of the fire, shortly before smoke was seen rising from that compartment. The report said that he may have left the storage area through an escape trunk and returned to his berthing area. A second sailor recalled Seaman Mays coming into the berthing area to “tell everyone to get off the ship because the ship was on fire.”

Seaman Mays filled out a questionnaire for investigators eight days after the fire broke out, and was the only member of the crew aboard the ship on July 12, 2020, who reported smelling a “burning fuel/rubbery smell” from the fire, the documents said. Investigators said the terminology Seaman Mays used to describe the smell of the fire was “consistent with items and materials” that special agents from the Bureau of Alcohol, Tobacco, Firearms and Explosives found in the vehicle storage compartment after the fire was extinguished.

Seaman Mays faces a preliminary hearing known as an Article 32 investigation, the results of which will either recommend he be sent to a court-martial or have the charges dismissed. The final decision on whether Seaman Mays will face trial will be made by the commander of the Navy’s Third Fleet, Vice Adm. Steve Koehler.

Cmdr. Sean Robertson, a spokesman for Third Fleet, confirmed that “Seaman Apprentice Ryan Sawyer Mays is the sailor who was charged July 29,” and said, “I have nothing further to add.”

Seamus Hughes contributed research.