Six people have been injured after a fire broke out on a nuclear-powered submarine docked in a US naval shipyard.

The blaze – which started in the "forward compartment" of the USS Miami shortly before 6pm local time on Wednesday – has not affected the vessel's reactor, which was not operating at the time.

Reports suggest there were no weapons aboard the submarine, which was at the Portsmouth naval shipyard in Kittery, Maine, for upgrades and maintenance.

Firefighters were still battling the blaze after 10pm, with equipment brought in from Logan international airport in Boston, about 60 miles away.

Six people – including one of the firefighters, who was suffering from heat exhaustion – have been treated and released, according to the shipyard authorities.

The fire still was not out shortly before midnight but a shipyard spokesman said the situation was improving.

All nonessential personnel on the submarine were ordered to evacuate when the blaze was reported. The cause of the fire is still unknown.

Local media reported that black smoke was visible in Portsmouth, New Hampshire. The naval shipyard is located on Seavey Island just over the New Hampshire-Maine border.

The Los Angeles class submarine, whose home port is Groton, Connecticut, arrived at the shipyard in March. The vessel typically carries a crew of 13 officers and 120 enlisted personnel.