The trouble began after a routine search of cells for contraband, the US military said in a statement.
It said the riot "spread to three additional compounds", and lasted 45 minutes before the prison guards opened fire. it said.
Prisoners were "throwing rocks and fashioning weapons
"Guards attempted to calm the increasingly volatile situation using verbal warnings and, when that failed, by use of non-lethal force," it said.
"After about 45 minutes of escalating danger, lethal force was used to quell the violence."
Six other prisoners were injured in the unrest at the prison, near the port of Umm Qasr, the military said.
An investigation has been launched into the incident.