Three suicide car bombers struck a security force barracks as gunmen opened fire, according to two police officers. At least 12 members of government and paramilitary security forces were killed and 35 wounded, they added. The clashes left a silo on fire, they said.
A medical official confirmed the casualty figures. All officials spoke on condition of anonymity as they were not authorized to release information.
The commander of military operations in western Baghdad, Maj. Gen Saad Harbiya, said the situation is "under control" and a local curfew has been imposed.
It is halfway between Baghdad and Fallujah, which is controlled by the IS group. Security forces prevented IS from seizing Abu Ghraib when the extremists swept across northern and western Iraq in the summer of 2014.