Militants attacked the headquarters of an Iraqi army battalion south of Baghdad overnight, killing at least 12 soldiers and bringing their fight against the government closer to the capital.

Police and medical sources said fighting began late on Wednesday when the assailants fired mortar rounds at the battalion’s headquarters in Yousifiya, around 15 to 20 km (9 to 10 miles)southwest of central Baghdad.

Roads leading to the area were closed off on Thursday as clashes continued and reinforcements were dispatched. In total, around 40 gunmen were either killed, wounded or detained, the sources said.