(Adds U.S. State Department comment, paragraphs 14-15)
By Raheem Salman and Oliver Holmes
BAGHDAD, July 1 (Reuters) - Sunnis and Kurds walked out of the first session of Iraq's new parliament on Tuesday after Shi'ites failed to name a prime minister to replace Nuri al-Maliki, dimming any prospect of an early national unity government to save Iraq from collapse.
The United States, United Nations, Iran and Iraq's own Shi'ite clergy have pushed hard for politicians to come up with an inclusive government to hold the fragmenting country together as Sunni insurgents bear down on Baghdad.
The leader of the al Qaeda offshoot spearheading the insurgency, the Islamic State, has declared a "caliphate" in the lands it has seized in Iraq and Syria. Its leader vowed on Tuesday to avenge what he said were wrongs committed against Muslims worldwide.
Despite the urgency, the Iraqi parliament's first session since its election in April collapsed when Sunnis and Kurds refused to return from a recess to the parliamentary chamber after Shi'ites failed to name a prime minister.
Parliament is not likely to meet again for at least a week, leaving Iraq in political limbo and Maliki clinging to power as a caretaker, rejected by Sunnis and Kurds.
Under a governing system put in place after the removal of Saddam Hussein, the prime minister has always been a member of the Shi'ite majority, the speaker of parliament a Sunni and the largely ceremonial president a Kurd.
The Shi'ite bloc known as the National Alliance, in which Maliki's State of Law coalition is the biggest group, has met repeatedly in recent days to bargain over the premiership but has so far been unable either to endorse Maliki for a third term or to name an alternative.
Fewer than a third of lawmakers returned from the recess. Sunni parties said they would not put forward their candidate for speaker until the Shi'ites pick a premier. The Kurds have also yet to nominate a president.
Osama al-Nujaifi, a leading Sunni politician, former speaker and strong foe of Maliki, warned that "without a political solution, the sound of weapons will be loud, and the country will enter a black tunnel".
He said his bloc did not have a candidate for a speaker so far and was waiting to see who the National Alliance would nominate for prime minister.
"If there is a new policy with a new prime minister, we will deal with them positively. Otherwise the country will go from bad to worse," Nujaifi said.
Shi'ite lawmakers sought to shift blame to the Sunni and Kurdish blocs, saying the premiership was the last position to be named in the constitutionally-defined process.
Mehdi al-Hafidh, parliament's oldest member who is tasked by the constitution with chairing the legislature's meetings until a speaker is named, said the next session would be held in a week, if agreement was possible after discussions.
The United States, which has been pressuring Iraq to form a more inclusive government, said it was a welcome sign that the Iraqi parliament had met on Tuesday as scheduled, but it said Baghdad should move more quickly to form the new government.
"Let's be clear, this needs to happen as soon as possible," said State Department spokeswoman Marie Harf. "It was important that Iraq's new parliament convened today, as they pledged to do. ... But we do hope that Iraq's leaders will move forward with the extreme urgency that the current situation deserves."
Baghdad can ill-afford further delays. Government troops have been battling for three weeks against fighters led by the group formerly known as the Islamic State in Iraq and the Levant (ISIL). This week it shortened its name to the Islamic State and declared its leader "caliph" - historic title of successors of the Prophet Mohammad who ruled the whole Muslim world.
Speaking for the first time since then, the group's leader Abu Bakr al-Baghdadi vowed revenge for what he said were wrongs committed against Muslims, calling on fighters to avenge them
"Your brothers, on every piece of this earth, are waiting for your rescue," Baghdadi purportedly said in an audio message that was posted online, naming a string of countries from Central African Republic to Burma where he said violations were being committed against Muslims.
"By Allah, we will take revenge, by Allah we will take revenge, even if after a while," he said in the Ramadan message. Baghdadi also called on Muslims to immigrate to the "Islamic State", saying it was a duty.
Fighting has raged in recent days near former dictator Saddam Hussein's home city, Tikrit, north of Baghdad. ISIL also controls suburbs just west of the capital and clashes have erupted to the south, leaving the city of 7 million confronting threats from three sides.
The United Nations said on Tuesday more than 2,400 Iraqis had been killed in June alone, making the month by far the deadliest since the height of sectarian warfare during the U.S. "surge" offensive in 2007.
In a reminder of that conflict, mortars fell near a Shi'ite holy shrine in Samarra which was bombed in 2006, unleashing the sectarian bloodshed that killed tens of thousands over the next two years. Samarra, north of Baghdad, is now held by Baghdad's troops with ISIL in the surrounding countryside.
Violence also struck the capital, where police found two bodies with their hands tied behind their back and bullet wounds in the head and chest in the mainly Shi'ite neighbourhood of Shula, police and medical sources said.
A bomb went off in Baghdad's western Jihad district, killing two passersby and wounding six more, police and medics said.
The insurgents' advance has triggered pledges of support for Baghdad from both Washington and Tehran.
On Tuesday, Iran's deputy foreign minister said his country had not received any request for weapons from Baghdad but was ready to supply them if asked.
Iraq also flew Russian-made Sukhoi Su-25 jets delivered on Saturday for the first time, state television reported, although there was no independent confirmation.
Saudi Arabia pledge $500 million in humanitarian aid for Iraqis to be disbursed through U.N. agencies, a Saudi Press Agency statement said.
Parliament opened its first session with an orchestra playing the national anthem and the recitation of a Quranic verse emphasising unity. Hafidh called on lawmakers to confront the crisis.
"The security setback that has beset Iraq must be brought to a stop, and security and stability have to be regained all over Iraq, so that it can head down the path in the right way toward the future," he said.
Lawmakers stood at the arrival of Maliki, who waved to his long-time foe Nujaifi and shook hands with Saleh al-Mutlaq, another leading Sunni politician.
But anger among the three main ethnic and sectarian groups soon flared when a Kurdish lawmaker accused the government of withholding salaries for the Kurds' autonomous region. Kadhim al-Sayadi, a lawmaker in Maliki's list, shouted back that Kurds were taking down Iraqi flags.
"The Iraqi flag is an honour above your head. Why do you take it down?" he shouted. "The day will come when we will crush your heads."
The dramatic advance by ISIL, which has dominated swathes of territory in an arc from Aleppo in Syria to near the western edge of Baghdad in Iraq, has stunned Iraq and the West. The group and allied militants seized border posts, oilfields and northern Iraq's main northern city Mosul in a lightning offensive in June.
Other Iraqi Sunni armed groups which resent what they see as persecution under Maliki are backing the insurgency.
Kurds have taken advantage of the advance to seize territory, including the city of Kirkuk, which they see as their historic capital and which sits above huge oil deposits.
Results of April's elections initially suggested parliament would easily confirm Maliki in power for a third term. But with lawmakers taking their seats after the collapse of the army in the north, politicians face a more fundamental task of staving off a breakup of the state.
Maliki's foes blame him for the rapid advance of the Sunni insurgents. Although Maliki's State of Law coalition won the most seats, it still needs allies to govern. Sunnis and Kurds demand that he go, arguing he favours his own sect, inflaming the resentment that fuels the insurgency.
The United States has not publicly called for Maliki to leave power but has demanded a more inclusive government in Baghdad as the price for more aggressive help.
Washington has so far pledged 300 mainly special forces advisers and said on Monday it was sending a further 300 troops to help secure the embassy and Baghdad airport.
Maliki's government, with the help of Shi'ite sectarian militias, has managed to stop the militants short of the capital but has been unable to take back cities its forces abandoned.
The army attempted last week to take back Tikrit but could not recapture the city, 160 km (100 miles) north of Baghdad, where ISIL fighters had machine-gunned scores of soldiers in shallow graves after capturing it on June 12. Residents said fighting raged on the city's southern outskirts on Monday.
On Friday, in an unusual political intervention, Grand Ayatollah Ali al-Sistani, Iraq's most senior Shi'ite cleric, called on political blocs to name the prime minister, president and speaker before parliament met on Tuesday.
Now that deadline has passed, a prominent Shi'ite lawmaker told Reuters he expected Sistani to keep up the pressure.
Maliki's close friends say he does not want to relinquish power, although senior members of his State of Law coalition have told Reuters an alternative premier from within his party was being discussed. Rival Shi'ite groups also have candidates.
Many worry that a drawn-out process will waste precious time in confronting the militants, who have vowed to advance on Baghdad. A Shi'ite lawmaker, speaking on condition of anonymity, said: "Things are bad. The political process is not commensurate with the speed of military developments." (Additional reporting by Isra' al-Rubei'i, Ahmed Rasheed, Ned Parker and Alexander Dziadosz in Baghdad and Gabriela Baczynska in Moscow and Yara Bayoumy in Dubai; Writing by Alexander Dziadosz; Editing by Peter Graff, Paul Taylor, Anna Willard and Cynthia Osterman)