This story was updated Sunday evening.
The fire started at about 8:30 a.m., Naval Surface Forces officials said. Seventeen sailors and four civilians were transferred to a local hospital with non-life threatening injuries, Mike Raney, a Naval Surface Force for U.S. Pacific Fleet, said. The entire crew is accounted for and off the ship.
Initial reports from Naval Surface Forces said 18 sailors were hurt in the fire.
The cause of the blaze is unknown, but the San Diego Fire Department tweeted Sunday afternoon that there was an explosion aboard the ship. Videos of the fire shared by the department show thick black smoke billowing from the ship.
Navy officials did not immediately respond to questions about the types of injuries the sailors suffered. The city fire department said the injuries varied in nature.
It's not immediately clear where the sailors are being treated.
There were about 160 people on the Bonhomme Richard when the fire started, according to Naval Surface Forces. The ship has a crew of about 1,000.
The amphib is docked at Naval Base San Diego, where it's undergoing routine maintenance. Local, base and shipboard firefighting teams responded to the blaze, Naval Surface Forces tweeted.
Two other ships, including one that recently returned to San Diego after years of maintenance following a fatal collision, were moved away from the Bonhomme Richard at about 1 p.m., Raney said. The destroyers Fitzgerald and Russell shifted berths to a pier further away from the fire, he said.
The Russell returned from a deployment last week.