BAGHDAD, Iraq (AP) _ An inmate in a Baghdad prison grabbed an assault rifle from a guard Wednesday and opened fire, killing eight people, the Interior Ministry said. One American soldier was injured in the attempted prison break, the U.S. military said.

The prisoner fired indiscriminately after grabbing an AK-47, killing four guards and four inmates, said Iraqi army Brig. Gen. Jalil al-Mehamadawi. The Interior Ministry said one guard and three prisoners were wounded.

The U.S. military's account was slightly different. A statement by Sgt. Keith Robinson said ``it was reported that 16 prisoners attempted to escape the facility after first storming the armory and obtaining an undetermined number of weapons.''

Robinson said in addition to the eight deaths that one U.S. soldier and five prisoners were injured.

Guards overtook the gunman and restrained him, al-Mehamadawi said. The prison was a Justice Ministry facility that also housed foreigners, officials said.

Police in Karbala said 31 bodies had been unearthed in a mass grave discovered this week that's believed to date back to a 1991 uprising against Saddam Hussein. Officials hoped to identify the bodies through DNA testing.

In violence Wednesday, gunmen killed a major in the former Iraqi army and a person in the car with him in eastern Baghdad, police Lt. Thair Mahmoud said. Gunmen in west Baghdad killed Interior Ministry Brig. Haider Ali Saied, a hospital official said.

___

Associated Press reporters Jason Straziuso in Baghdad and Yahya Barzanji in Irbil contributed to this report.