US Secretary of State John Kerry on Monday pledged "intense" support for Iraq against the "existential threat" of a major militant offensive pushing toward Baghdad from the north and west.
"The support will be intense, sustained, and if Iraq's leaders take the steps needed to bring the country together it will be effective," Kerry told reporters after a day of meetings in Baghdad.
Kerry made the remarks at the US embassy in Baghdad, in the heavily-fortified Green Zone, after talks with Iraqi Prime Minister Nuri al-Maliki and other leaders from across the political and communal spectrum.
A major militant offensive, led by the jihadist Islamic State of Iraq and the Levant (ISIS) but involving a raft of other Sunni groups as well, began in Iraq's main northern city Mosul on June 9.
The militants took the city the following day, swept through the surrounding province of Nineveh and took major parts of four more provinces as well.
Baghdad has appealed for US air strikes against militants, but Washington has not acceded to that request, instead offering up to 300 military advisers.
Kerry earlier arrived in Baghdad on a mission to push for Iraqi unity and stability to confront a militant offensive threatening to tear the country apart.
Kerry flew in from Jordan on a visit which the state department had sought to keep secret amid security concerns.
Watch: Iraqi militants capture two more border crossings
Last week, President Barack Obama announced he was sending up to 300 military advisors to assist the Iraqi security forces, which are battling militants led by the Islamic State of Iraq and the Levant (ISIS), and was considering ordering up air strikes.
Read: ISIS seize more Iraq towns as US warns on spillover
Not 'picking and choosing'
Kerry's trip came a day after he hinted Washington's support for the Shiite premier Maliki was waning even though he insisted the US was not "picking and choosing" Iraq's leaders.
"The United States would like to see the Iraqi people find leadership that is prepared to represent all of the people of Iraq," Kerry told reporters in Cairo on Sunday at the end of a surprise visit to Egypt.
He noted that minority Kurds and Sunni Arabs, and even some within Maliki's own Shiite community, had voiced dissatisfaction with the premier's leadership, and said the government had to "rise above sectarian motivations".
Iraqi security forces fire artillery during clashes with Sunni militant group ISIS on the outskirts of the town of Udaim in Diyala province. (Reuters photo)
The Iraqi government has "to be inclusive and share power in a way that will maximise the ability of Iraq to focus on the real danger at this moment from an external source, which is ISIS," Kerry insisted.
A top US official who has been on the ground in Iraq told reporters that there was "a lot of anxiety and a lot of looking to the US for help".
Read: Iran rejects US action in Iraq, ISIL tightens Syria border grip
The top US diplomat called on all of Iraq's neighbours to urge Iraqis "to form a government that is united in its determination to meet the needs and speak to the demands of all of their people."
The Sunni militants pressed their advance in western Iraq on Sunday, killing 21 people after security forces abandoned a string of towns, allowing the insurgents to widen access to Syria.
The advance marked the latest in a series of setbacks for Iraqi forces, which are struggling to hold their ground in the face of the onslaught that has displaced hundreds of thousands of people.
The militants, led by ISIS, seized the towns of Rawa and Ana after taking the Al-Qaim border crossing on Saturday, residents said.
Kurdish security forces take positions behind sand barriers at the Baashiqa town, northeast of Mosul, Iraq. (AP photo)
Iraq in political limbo
Kerry's task was complicated as Iraq is in a political limbo after April elections in which Maliki won the largest number of seats, but not a majority, meaning some bitter bargaining to form a coalition.
"It all comes down to the maths and how they can put together a governing coalition... what makes this one so complicated is that it's so fractured," the US official told reporters on a conference call.
Under a de facto system in Iraq following recent elections, a Kurd has traditionally held the presidency, a Shiite Arab has been the prime minister and a Sunni Arab has been the speaker of parliament.
Read: ISIS militants may use 39 abducted Indians as human shields, fears govt
But no side has yet put forward their candidate, leading to a political stalemate. "A lot of decisions have to be made by Iraqis and they have to be made soon," the US official said.
Kerry also warned all countries, particularly in the Gulf, that "there is no safety margin whatsoever in funding a group like ISIL."
"We particularly discourage individuals in the region who may have been sending money through some innocent charity or through various backchannel initiatives under the guise that it's for the general welfare and benefit of people who've been displaced."
Full coverage: Iraq on the brink