SAN DIEGO - Flames tore through a warship for a second day Monday as a top Navy official revealed that a fire suppression system was inoperable when the blaze erupted while the ship was docked in San Diego.

Hundreds of sailors were battling to keep flames away from a million gallons (3.7 million litres) of oil on board the USS Bonhomme Richard. The U.S. Coast Guard hired an oil clean-up crew to put in place a containment boom that could be ready if any oil is spilled. It also halted boat traffic within one-nautical mile of the ship and flights over the vessel.

Meanwhile, acrid smoke from the blaze wafted across San Diego and health officials urged people to stay indoors if they smelled it.

The fire that erupted Sunday morning is one of the Navy's worst shipyard fires in recent years. At least 59 people, including 36 sailors and 23 civilians, have been treated for heat exhaustion, smoke inhalation and minor injuries. Five people who had been in a hospital under observation were released.

Rear Adm. Philip Sobeck said fire temperatures had reached up to 1,000 degrees, causing the mast of the ship to collapse and threatening the central control island where the captain operates the vessel. He said there were about two decks between the fire and the fuel supplies on board.

Water being dumped on the vessel to douse the flames was causing the 840-foot (255-meter) ship to list to one side, but crews were pumping off the water.

Sobeck said it was too soon to give up on saving the 23-year-old amphibious assault ship, which has been docked in San Diego since 2018 undergoing maintenance.

“In the last 24 hours, 400 sailors have been on board that ship to make sure that, you know, we make every effort to save that ship,” said Sobeck, commander of Expeditionary Strike Group 3.

Retired Navy Capt. Lawrence B. Brennan, a professor of international maritime law at Fordham University in New York, said there is a risk of the hull rupturing, which could cause the ship to spill its oil and leave the Navy looking at a major environmental mess.

“If this is a million gallons of oil that ends up settling on the bottom of the San Diego harbour and can't be removed safely, we're talking about billions of dollars of environmental damage,” said Brennan, who has investigated and litigated hundreds of maritime cases.

The fire was first reported in a lower cargo area where seafaring tanks and landing craft are parked. It appears to have started in a spot where cardboard boxes, rags and other ship maintenance supplies were being stored, Sobeck said.

Sobeck believes the cardboard and other supplies might have been what first ignited, though the exact cause is still unknown.

The fire suppression system had been turned off because it was being worked on as part of the ongoing maintenance. The system uses Halon, a liquefied, compressed gas that disrupts a fire and stops its spread by cutting off its oxygen.

Sailors on board and from the pier doused the blaze until it grew too large and they had to retreat. Local and federal firefighters were called in, and an explosion occurred caused by pressure from the heat prompted the evacuation of all 160 people on board, Sobeck said.

Brennan said it's common that a ship would deactivate the Halon system while it is being worked on because the gas can be dangerous to humans. But the fire' extensive and rapid spread indicates the Navy might not have done enough to compensate for the deactivation of the suppression system, and had “poor or no fire boundaries” in place, he said.

“This fire got to pretty much every space on the ship, and to exacerbate the problem, I keep getting signs that there were flammable substances in a lot of spaces - like gear from the shipyard, rags and cloth,” he said. “Ship fires are often unfortunate but not catastrophic in most cases. They usually don't get out of control this badly.”

The flames were burning plastic, cabling and other material on board, sending the haze over downtown San Diego. The San Diego Air Pollution Control District warned that concentrations of fine particulate matter could reach unhealthful levels in some areas and that people should avoid exercising outdoors and stay indoors if possible to limit exposure.

Sobeck said there was no ordnance on board the ship and he did not believe there was anything toxic.

Firefighters attacked the flames inside the ship while firefighting vessels with water cannons directed streams of seawater into the ship and helicopters made water drops.

The ship can be used to deploy thousands of Marines to shore and has the capacity to accommodate helicopters, certain types of short-takeoff airplanes, small boats and amphibious vehicles.