US Secretary of State John Kerry has said US support for Iraqi security forces will be "intense and sustained" to help them combat a militant insurgency that has swept through the north and west of the country.

Mr Kerry said that Iraqi leader Nouri al-Maliki reaffirmed his commitment to a 1 July deadline for forming a new government.

He met the Iraqi prime minister in Baghdad this morning to push for a more inclusive government.

They met as the Iraqi premier's security spokesman, Lieutenant General Qassem Atta, announced on television that "hundreds" of Iraqi soldiers had been killed by Sunni Arab militants since the insurgents launched their offensive on 9 June. 

Baghdad's forces have abandoned the border with Jordan, leaving the entire Western frontier outside government control.

Sunni tribes took the Turaibil border crossing, the only legal crossing point between Iraq and Jordan, after Iraqi security forces fled, Iraqi and Jordanian security sources said.

The tribes were negotiating handing the post over to insurgents from the Islamic State of Iraq and Syria (ISIS), also known as ISIL, who took control of two main crossings with Syria over the weekend.

Kurdish forces control a third border post with Syria in the north.

Jordanian army sources said Jordan's troops had been put in a state of alert in recent days along the 181km border with Iraq, redeploying in some areas as part of steps toward off "any potential or perceived security threats".

The US, which withdrew its troops from Iraq in 2011 after an occupation that followed the 2003 invasion that toppled dictator Saddam Hussein, has been struggling to help Iraq contain a Sunni insurgency led by ISIS, an al-Qaeda offshoot which seized northern towns this month.

US President Barack Obama agreed last week to send up to 300 special forces troops as advisers, but has held off from providing air strikes and ruled out redeploying ground troops.

The US is worried that Mr Maliki's Shia-led government has worsened the insurgency by alienating moderate Sunnis who once fought al-Qaeda but have now joined the ISIS revolt.

While the US has been careful not to say publicly that it wants Mr Maliki to relinquish power, Iraqi officials say such a message has been delivered behind the scenes.

Iran's Supreme Leader Ayatollah Ali Khamenei yesterday accused the US of trying to regain control of the country it once occupied - a charge Mr Kerry denied.

Iraqis are due to form a new government after an election in April.

Mr Maliki's list won the most seats in parliament but would still require allies to win a majority.

Mr Kerry said yesterday the United States would not choose who rules in Baghdad, but added that the US had noted the dissatisfaction among Kurds, Sunnis and some Shias with Mr Maliki's leadership.

He emphasised that the United States wanted Iraqis to "find a leadership that was prepared to be inclusive and share power".

Senior Iraqi politicians, including at least one member of Mr Maliki's own ruling list, have said that the message that the US would be open to Mr Maliki leaving power has been delivered in diplomatic language to Iraqi leaders.

Recent meetings between Mr Maliki and American officials have been described as tense.

According to a Western diplomat briefed on the conversations by someone attending the meetings, US diplomats have informed Mr Maliki he should accept leaving if he cannot gather a majority in parliament for a third term.

US officials have contested that such a message was delivered.

A close ally of Mr Maliki has described him as having grown bitter toward the Americans in recent days over their failure to provide strong military support.

The militants' control of the Western frontier extends two weeks of swift territorial gains and boosts ISIS's goal of a caliphate straddling Syria and Iraq.

The Jordan border was in the hands of Sunni tribesmen.

An Iraqi tribal figure said there was a chance it would soon be passed to control of the militants, who seized the nearby crossing to Syria on the Damascus-Baghdad highway yesterday.

He said he was mediating with ISIL in a "bid to spare blood and make things safer for the employees of the crossing. We are receiving positive messages from the militants."

The need to battle the Sunni insurgency has put the United States on the same side as its enemy of 35 years, Iran, which has close ties to the Shia parties that came to power in Baghdad after US forces toppled Saddam.

However, Iran's Supreme Leader Khamenei made clear yesterday a rapprochement would not be easy.

"We are strongly opposed to US and other intervention in Iraq," IRNA news agency quoted Mr Khamenei as saying.

"We don't approve of it as we believe the Iraqi government, nation and religious authorities are capable of ending the sedition."

Some Iraqi observers in Baghdad interpreted Mr Khamenei's comments as a warning to the United States to stay out of the process of selecting any successor to Mr Maliki.

Meanwhile, 69 detainees were killed during a militant attack on a convoy transporting them south of Baghdad this morning, officials said.

Seven gunmen died in the ensuing clashes, according to a police captain and a doctor at a hospital the town of Hashimiyah, in Babil province.

It was not immediately clear how the detainees died.