Militants attacked the northern Iraqi town of Hawija with car bombs and mortars on Wednesday in an assault that killed four insurgents and wounded nine people including two soldiers and a policeman, police and hospital sources said.

The attack began when two suicide bombers blew up car bombs near the police headquarters and government buildings in Hawija, a senior police source said. Four mortar rounds then landed in the same area.

Hawija is located 210 km (130 miles) north of Baghdad and about 60 km (37 miles) southwest of Kirkuk, the volatile northern oil city that is considered a potential flashpoint for conflict when U.S. troops leave Iraq by the end of the year.

After these attacks a number of militants tried to invade Hawija police headquarters and they clashed with the police, said the police source, who declined to give his name because he is not authorised to speak to the media.

Police killed two of the assailants and the rest fled, he said.

The attacks underscored Iraq's delicate security situation as the last U.S. troops prepare to withdraw, more than eight years after the invasion that toppled Sunni dictator Saddam Hussein.

Violence in Iraq has fallen sharply since the height of sectarian strife in 2006-07 but Sunni Islamist insurgents and radical Shi'ite militias still carry out daily attacks, assassinations and bombings.

Government offices and security forces have been frequent targets as militants try to destabilise Iraq's frail coalition government.

(Reporting by Mustafa Mahmoud; Writing by Aseel Kami; Editing by Jim Loney)