Clashes between security forces and militants near the Iraqi capital killed 20 security personnel on Saturday, an army officer and doctors said.