Baghdad: Iraqi soldiers killed more than 40 militants in clashes near Baghdad on Thursday as anti-government fighters edged close to the capital just weeks before national parliamentary elections.

The firefight was the latest in a surge in bloodshed over the past year, amid fears insurgents could seek to destabilise the April 30 polls by upping the pace of attacks with violence already at its worst since 2008.

The bloodshed comes with campaigning underway ahead of the elections, Iraq’s first since March 2010, which the UN’s special envoy has warned will be “highly divisive”.

On Thursday morning, militants attacked an army camp in Yusifiyah, just southwest of the capital, the interior ministry said in a statement.

More than 40 insurgents died in the ensuing firefight, with one army officer also killed.

“Iraqi security forces confronted a failed attempt by Daash gang members to break into a military camp,” the statement said, referring to the Arabic abbreviation for the powerful Islamic State of Iraq and the Levant (Isil) jihadist group.

“The security forces ... killed more than 40 terrorist attackers, and the attack resulted in the death of one of our officers when he was confronting these criminal gangs.”

Two heavy machineguns, 15 rifles and five grenade launchers were seized, along with other equipment, the statement said.

The clashes in Yusifiyah come after days of fighting in the Zoba and Zaidan areas west of Baghdad.

The fighting spurred concerns that militants who have for months controlled the town of Fallujah, a short drive from Baghdad, could be looking to open a new front to encroach on the capital.

Elsewhere on Thursday, a car bomb in northern Iraq, near the restive ethnically-mixed town of Tuz Khurmatu, killed four soldiers and wounded 12 other people, said the mayor, Shallal Abdul.

More than 2,300 people have been killed in Iraq so far this year, with unrest at its highest level since 2008 when the country was emerging from a brutal Sunni-Shiite sectarian war that left tens of thousands dead.

The bloodletting has been principally driven by anger in the Sunni Arab community over alleged mistreatment at the hands of the Shiite-led government and security forces, as well as the civil war in neighbouring Syria.

Analysts and diplomats have urged the authorities to reach out to the Sunni community to undermine support for militancy, but with the elections looming, Maliki and other Shiite leaders have been loath to be seen to compromise.

UN special envoy Nickolay Mladenov has warned that the election campaign will be “highly divisive”, underscoring fears that the polls could worsen a long-standing political deadlock in which Iraq’s fractious unity government has passed little in the way of significant legislation.

“Campaigning will be highly divisive,” Mladenov said in an interview.

“Everyone is ratcheting it up to the maximum, and you could see this even before officially the campaign started.”

Mladenov, a former Bulgarian foreign and defence minister, added: “I would hope that it would be more about issues, and how the country deals with its challenges, but at this point, it’s a lot about personality attacks.”

“The efforts to reach across the sectarian divide are very weak.”