A U.S. soldier fired on fellow troops Monday, killing five before being taken into custody, the U.S. command said.
The shooting occurred at Camp Liberty, a sprawling U.S. base on the western edge of Baghdad near the city's international airport and adjacent to another facility where President Barack Obama visited last month.
A brief U.S. statement said the soldier "suspected of being involved with the shooting" was in custody but gave no further details. It was unclear what provoked the attack.
"Any time we lose one of our own, it affects us all," U.S. spokesman Col. John Robinson said. "Our hearts go out to the families and friends of all the service members involved in this terrible tragedy."
Pentagon spokesman Bryan Whitman called the shooting an "unexpected and tragic event," adding that the incident is under investigation.
The names of the deceased are being withheld pending next-of-kin notification and release by the Defense Department.
Separately, the military announced Monday that a U.S. soldier was also killed a day earlier when a roadside bomb exploded near his vehicle in Basra province of southern Baghdad.
The death toll from the Monday shooting was the highest for U.S. personnel in a single attack since April 10, when a suicide truck driver killed five American soldiers with a blast near a police headquarters in Mosul.
Attacks on officers and sergeants, known as fraggings, were not uncommon during the Vietnam war as morale in the ranks sank. However, such attacks are believed to be rare in the wars in Iraq and Afghanistan.
In 2003, Army Sgt. Hasan Akbar was sentenced to death for killing two officers in Kuwait just before the U.S.-led invasion of Iraq of 2003.
In June 2005, an Army captain and lieutenant were killed when an anti-personnel mine detonated in the window of their room at the U.S. base in Tikrit. A National Guard sergeant was acquitted in the blast.
Additionally, there have been several cases recently of gunmen dressed as Iraqi soldiers opening fire on American troops, including an attack in the northern city of Mosul on May 2 in which two soldiers and the gunman were killed.
Also Monday, a senior Iraqi traffic officer was assassinated on his way to work in Baghdad. It was the second attack on a high-ranking traffic police officer in the capital in as many days.
A car cut off Brig. Gen. Abdul-Hussein al-Kadhoumi as he drove through a central square in the capital and a second vehicle pulled up alongside and riddled him with bullets, police said, citing witnesses. Al-Kadhoumi was director of operations for the traffic authority.
The gunmen were armed with pistols equipped with silencers, the police added on condition of anonymity because they were not authorized to speak to the media.
Incidents involving gunmen armed with sophisticated weapons, including silencers, have been on the rise since a string of high-profile robberies in April.