Sunni insurgents have seized a mainly ethnic Turkmen city in northwestern Iraq after heavy fighting, solidifying their grip on the north after a lightning offensive that threatens to dismember Iraq.

Residents reached by telephone in the city of Tal Afar said it had fallen to the rebels from the Islamic State of Iraq and the Levant (ISIL) after a battle that saw heavy casualties on both sides.

"The city was overrun by militants. Severe fighting took place, and many people were killed. Shi'ite families have fled to the west and Sunni families have fled to the east," a city official said.

Tal Afar is a short drive west from Mosul, the north's main city, which the ISIL fighters seized last week at the start of a drive that has plunged the country into the worst crisis since US troops withdrew.

The advance has alarmed Prime Minister Nuri al-Maliki's Shi'ite supporters in Iran as well as the US, which helped bring Maliki to power after its 2003 invasion that toppled Sunni dictator Saddam Hussein.

The US was also preparing to open a direct dialogue with longtime arch-foe Iran on the security situation in Iraq and ways to push back Sunni militants, the Wall Street Journal reported.

Iran has held out the prospect of working with the United States to help restore security in Iraq.

Tal Afar had been defended by an unit of Iraq's security forces commanded by a Shi'ite major general, Abu Walid, whose men were among the few holdouts from the government's forces in the province around Mosul not to flee the rapid ISIL advance.

After sweeping through towns in the Tigris valley north of Baghdad, ISIL fighters appear to have halted their advance outside the capital, instead moving to tighten their grip on the north.

Most of the inhabitants of Tal Afar are members of the Turkmen ethnic group, who speak a Turkic language. Turkey has expressed concern about their security.

The Turkmen and other residents of Tal Afar are divided among Sunnis and Shi'ites in a part of Iraq with a complex ethnic and sectarian mixture.

The city is just outside Iraq's autonomous Kurdish region, whose own security forces have taken advantage of the collapse of government control to advance into the city of Kirkuk and rural areas with oil deposits.

ISIL fighters aim to establish a caliphate on both sides of the Syria-Iraqi frontier based on strict medieval Sunni Muslim precepts. Their advance has been assisted by other Sunni Muslim armed groups.

US President Barack Obama has said he is reviewing military options, short of sending troops, to combat the insurgency.

The Pentagon said in a statement that a small number of defence personal "are augmenting State Department security assets in Baghdad to help ensure the safety of our facilities."

A US military official said fewer than 100 people would be involved, including Marines and other soldiers.

The vast mission is the largest and most expensive embassy ever built anywhere in the world, a vestige of the days when the United States had 170,000 troops in Iraq battling to put down a sectarian civil war that followed its invasion.

Iraq now faces the prospect of similarly vicious warfare, but this time with no US forces on the ground to intervene.

Its million-strong army, trained and armed by Washington at a cost of around US$25 billion, has been plagued by corruption, poor morale and a perception it pursues Shi'ite sectarian interests.

'CRAZY FIGHTING'

Residents in Tal Afar said Shi'ite police and troops rocketed Sunni neighbourhoods before the ISIL forces moved in and finally captured the city. A member of Maliki's security committee told Reuters government forces had attacked ISIL positions on the outskirts of the city with helicopters.

"The situation is disastrous in Tal Afar. There is crazy fighting and most families are trapped inside houses, they can't leave town," a local official said on Sunday before the city was overrun. "If the fighting continues, a mass killing among civilians could result."

Shi'ites, who form the majority in Iraq and are based mainly in the south, have rallied to defend the country, with thousands of volunteers turning out to join the security forces after a mobilisation call by the top Shi'ite cleric. Maliki's security forces and allied militias regained some territory on Saturday.

In Baghdad on Sunday, a suicide attacker detonated explosives in a vest he was wearing, killing at least nine people and wounding 20 in a crowded street in the centre of the capital, police and medical sources said.

At least six people were killed, including three soldiers and three volunteers, when four mortars landed at a recruiting centre in Khalis, one of the last big towns in government hands north of the capital, 50km north of Baghdad.

Volunteers were being gathered by the army to join fighting to regain control of the nearby town of Udhaim.

ISIL fought as al Qaeda's Iraq branch against US forces during the years of American occupation in Iraq, but broke away from al Qaeda after joining the civil war in Syria. It now says the group founded by Osama bin Laden is not extreme enough.

In years of fighting on both sides of the frontier, ISIL has gained a reputation for shocking brutality. It considers Shi'ites to be heretics deserving of death and sends bombers daily to kill hundreds of Iraqi civilians each month.

A series of pictures distributed on a purported ISIL Twitter account appeared to show gunmen from the Islamist group shooting dozens of men, unarmed and lying prone on the ground.

Captions accompanying the pictures said they showed hundreds of army deserters who were captured as they tried to flee the fighting. They were shown being transported in the back of trucks and led to an open field where they were laid down in rows and shot by several masked gunmen. In several pictures, the black Islamist ISIL flag can be seen.

Most of the captured men were wearing civilian clothes, although one picture showed two men in military camouflage trousers, one of them half covered by a pair of ordinary trousers.

"This is the fate of the Shi'ites which Nuri brought to fight the Sunnis," a caption to one of the pictures reads. Others showed ISIL fighters apparently seizing facilities in Tikrit, Saddam Hussein's hometown, which they captured on Wednesday.

It was not immediately possible to verify the authenticity of the pictures.

Across the border, a Syrian government air raid hit near ISIL's headquarters in the eastern city of Raqqa, Syrian activists said.

The only Syrian provincial capital in insurgent hands, Raqqa has been a major base for ISIL since the group evicted rival rebels, including al Qaeda's Syrian affiliate, during infighting this year.

The Britain-based Syrian Observatory for Human Rights said warplanes targeted the governorate building, a large structure in the centre of town, as well as two other buildings, including a sharia, or Islamic law, court.