* Fighting spreads to northwest town near Syria border
* Pictures appear to show ISIL fighters shooting dozens
* Nine killed in Baghdad suicide bombing
* Washington boosting security at Baghdad embassy
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 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," said a city official who asked not to be identified.
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 U.S. troops withdrew.
The advance has alarmed Prime Minister Nuri al-Maliki's Shi'ite supporters in Iran as well as the United States, which helped bring Maliki to power after its 2003 invasion that toppled Sunni dictator Saddam Hussein.
While expressing support for Maliki's government, the United States has stressed the need for a political solution to the crisis. Maliki's opponents accuse him of sidelining Sunnis, which fuelled resentment that fed the insurgency.
In the face of the mounting security crisis, Washington on Sunday ordered military personnel to boost security for its diplomatic staff in Baghdad and said some staff were being evacuated from the embassy as the Iraqi government battled to hold off insurgents.
The United States is also considering holding discussions with Iran on ways to push back Sunni militants in Iraq, a senior official said on Sunday, in what would mark a major step in U.S. engagement with its longtime adversary.
A White House official cautioned no discussions had yet taken place, saying: "There has been no contact with Iran on this issue thus far, nor do we have any plans to preview."
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.
U.S. President Barack Obama has said he is reviewing military options, short of sending troops, to combat the insurgency.
The Pentagon said in a statement a small number of defense personal "are augmenting State Department security assets in Baghdad to help ensure the safety of our facilities."
A U.S. military official said fewer than 100 people would be involved, including Marines and other soldiers.
In a new warning to Americans against all but essential travel to Iraq, the State Department said: "The U.S. government considers the potential threat to U.S. government personnel in Iraq to be serious enough to require them to live and work under strict security guidelines."
The vast U.S. 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 U.S. forces on the ground to intervene. Its million-strong army, trained and armed by Washington at a cost of around $25 billion, has been plagued by corruption, poor morale and a perception it pursues Shi'ite sectarian interests.
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."
BROKE AWAY FROM AL QAEDA
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, 50 km (30 miles) 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 U.S. 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's hometown, which they captured on Wednesday.
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.
The fighting in Iraq is by far the worst since U.S. troops pulled out in 2011. Obama has come under fire at home for failing to do more to bolster Baghdad.
Oil prices have risen to the highest level this year over fears of the violence disrupting exports from the OPEC member.