BAGHDAD - An ever more isolated Nuri al-Maliki again protested his removal as Iraqi prime minister on Wednesday as his former sponsor in Iran publicly endorsed a successor who many in Baghdad hope can halt the advance of the militants.

While Maliki, abandoned by former backers in the United States and Iraq's Shia political and religious establishment, pressed his legal claim on power, premier-designate Haider al-Abadi held consultations on forming a coalition government that can unite warring factions after eight years that saw the Sunnis driven to revolt by what they saw as Maliki's sectarian bias.

The White House on Wednesday urged Iraqi leader Nuri al-Maliki to step aside and allow the man nominated to become his successor as prime minister to form a government. "He needs to respect that process," US national security spokesman Ben Rhodes told reporters. "This is what the Iraqis themselves have decided to do."

President Barack Obama on Monday threw his weight behind the choice of Haidar al-Abadi to form a new government, appealing to Maliki, without directly naming him, to peacefully turn over power. "The White House will be very glad to see a new government in place with prime minister Abadi at the lead of that government," Rhodes said.

Meanwhile, thousands of civilians who escaped a militant siege streamed into Kurdish-controlled northern Iraq Wednesday, as the West ramped up efforts to assist those still trapped and arm Kurdish forces battling to break the siege.

The United States has carried out air strikes against militants of the Islamic State (IS) group in Mount Sinjar, a border area of Iraq where the UN refugee agency says 20,000-30,000 civilians, many of them members of the Yazidi minority, remain besieged.

Thousands poured across the border bridge into camps in Iraq's autonomous Kurdish region on Wednesday after trekking through neighbouring Syria to find refuge, most with nothing but the clothes they were wearing.

Some women carried exhausted children, weeping as they reached the relative safety of Iraqi Kurdistan after fleeing the militant offensive which drove Kurdish forces from their home villages. But large numbers of people, including the most vulnerable, remain trapped on Mount Sinjar, said Mahmud Bakr, 45.

The government forces and their allies among the ethnic Kurdish militias of northern Iraq were in action on the frontlines against the fighters of the Islamic State as European Union states began to follow the US lead and provide arms direct to the Kurds and step up efforts to help tens of thousands of refugees fleeing the advancing hardline Islamists.

Though Maliki has built up a network of commanders in the armed forces and Shia militias who owe him personal ties of loyalty, there was no sign that he was ready to resort to force against Abadi, a long-time associate in the Islamic Dawa Party.

In a speech on state television, in his continuing capacity as acting prime minister, Maliki said he was waiting for the supreme court to rule on his complaint that, as leader of the biggest bloc in the parliament elected in April, it was he, not Abadi, whom the president should invite to form a government. A court ruling against Maliki could be a way out of the stand-off.

"The violation that occurred has no value," Maliki said. "This government is continuing, and will not be changed except after the Federal Court issues its decision."

But the United States, during whose occupation Maliki first rose to power, made clear again that it has had enough of him - the White House said it would be glad to see an Abadi government and urged Maliki to let the political process move forward.

And Iranian Supreme Leader Ayatollah Ali Khamenei, bound to Tehran's US adversary by a common interest in curbing the rise of militants in Syria and Iraq, offered his personal endorsement to Abadi. He very publicly distanced himself in the process from Maliki, who has looked for support from Iran, where he spent years in exile opposing dictator Saddam Hussein.

"I hope the designation of the new prime minister in Iraq will untie the knot and lead to the establishment of a new government and teach a good lesson to those who aim for sedition in Iraq," Khamenei said in a statement on his website.

Iranian media carried reports that Khamenei sent an envoy last month to take part in discussions with Shia political and religious leaders to find an alternative to Maliki.

Those leaders, including reclusive top cleric Grand Ayatollah Ali al-Sistani, last week rallied around Abadi, who once ran a British engineering company, as a compromise figure who could bring moderate Sunnis into power.

In online statements, Abadi said on Wednesday he had called on the various political blocs to appoint representatives to take part in talks on forming a cabinet. He hoped for a "strong government" that could help the country resolve the "crises and problems it faces on the political and security levels".

There was more familiar bloodshed in Baghdad, where at least 12 people were killed by bombs in two mainly Shia areas.

And there was violence too on the 1,000-kilometre (600-mile) front established by the Islamic State, which exploited the political stalemate in Baghdad to burst beyond strongholds in Syria to claim a cross-border caliphate occupying up to a third of Iraq.

Kurdish peshmerga militia sources said their forces clashed with IS fighters in Diyala, northeast of Baghdad. In the provincial capital, Baquba, five Muslims were killed when Shia gunmen shot them as they prayed in a mosque.

Government forces, who collapsed in the face of the Islamic State in June, fought alongside volunteers around the Tikrit, north of the capital, and residents also reported skirmishes in the western cities of Ramadi and Falluja.

With ethnic Kurdish Peshmerga forces pushed back on the defensive by the Islamic State this month, France announced it was joining the United States in urgently supplying arms to the autonomous regional force, and EU foreign ministers agreed to break summer holidays to meet on Friday to discuss the crisis.

In addition to arming the Peshmerga and, in the case of Washington, bombing militant positions, Western powers have been trying to help aid agencies drop supplies and provide refuge for tens of thousands of people, many of them from non-Sunni communities, who have fled attacks by the Islamic State.

The White House said the United States was looking with its allies at setting up airlifts and safe land corridors to rescue people, including many from the Yazidi sect stranded on the arid heights of Mount Sinjar near the Syrian border.

In a sign of how Western powers could be drawn back into a region despite public reluctance to repeat the experience of the last decade, the White House said that while President Barack Obama has ruled out sending back combat troops to Iraq it could not rule out ground troops being used in a humanitarian role.