Officials at the Portsmouth Naval Shipyard said the nuclear reactor of the USS Miami was not affected and was not operating at the time.
The shipyard said the injured people have been treated and released. A firefighter was among the injured and suffered heat exhaustion.
The attack sub has been in the dry dock since March for routine maintenance. The cause of the fire is under investigation.
The Associated Press contributed to this report.