Washington — On his hastily planned trip to the Middle East, Secretary of State John Kerry has sought to highlight how the territorial advances of the Islamic State in Iraq and the Levant (ISIS) pose a grave threat not just to Iraq, but to the region as well.

The weekend capture by ISIS militants of border crossings into Iraq’s western neighbors dramatically underscored just this point.

Iraqi security forces claimed Monday to have retaken the Trebil border post with Jordan and another border crossing into Syria at al-Waleed. Both were overrun on Sunday by militants who continued over the weekend to add to the list of western Iraqi towns they control.

But the ability of ISIS to seize the border crossings, even for a short time, prompted Jordan to send troops and tanks to reinforce its border with Iraq and deepened worries in an already shaken region.

Speaking in Amman Sunday before leaving for a full day of talks in Baghdad Monday with Iraqi leaders, Mr. Kerry warned that the ISIS militants’ goal of establishing a strict Islamist state is a threat “to the entire region.”

In Baghdad, Kerry focused on the other goal of his trip, which is to prompt swift formation of a new Iraqi government that would include meaningful representation of all of Iraq’s sectarian communities – but in particular the alienated Sunnis.

Saying “the very future of Iraq depends on choices that will be made in the next days and weeks,” Kerry said Iraqi Prime Minister Nouri al-Maliki committed in their meeting to begin next week the process of forming a new government based on results of April 30 elections. The US is pressing Mr. Maliki, a Shiite, and other political leaders to form a more inclusive government, one that would presumably unite a fractured Iraq to meet the militant threat.

Kerry said that US efforts to aid Iraq, including with military assistance, could only work if Iraq’s leaders make the right political choices that unify the country against the militants. “The [US] support will be intense and sustained,” Kerry said, “and if Iraq’s leaders take the necessary steps to bring the country together, it will be effective.”

But Kerry, who made no claims of securing commitments from the embattled Maliki to reach out to his Sunni political rivals, also hinted that President Obama could opt to take military action to thwart the ISIS threat even in the absence of Iraqi political action.

Saying that ISIS, which the State Department lists as an international terrorist organization, “cannot be given safe haven anywhere,” Kerry said he was compelled to repeat that “the president will not be hampered if he deems it necessary [to act] if the formation [of a new government] is not complete.”

With his talks of denying “safe havens,” Kerry appeared to be setting the stage for the kind of unilateral military action Mr. Obama has taken in Pakistan and Yemen – primarily through drone strikes – if he finds US national security or American national security interests to be at risk.

With US and other Western officials broadly concluding that it will be a long time at best before Iraq’s weak and dispirited security forces are able to rebuild and take back territory already lost to ISIS, questions are growing as to the most effective international action to address the Sunni extremist threat.

That is where Kerry’s consultations with regional players and international leaders come in. In addition to Egypt, Jordan, and Iraq, Kerry is also to make stops in Brussels and Paris, where the State Department says he will consult with Western officials and representatives of other regional powers, including the Gulf states.

The US is particularly concerned that countries like Saudi Arabia and Qatar with no liking for Maliki – or for Syria’s Bashar al-Assad – have done nothing to hinder a flow of funding to Sunni insurgencies in Iraq and Syria, including ISIS.

ISIS is now considered to be the world’s wealthiest jihadist organization, in part from outside funding but more recently as a result of an immense fortune in gold and dollars seized as the group has taken control of major Iraqi cities including Mosul, the country’s major northern commercial hub.

In his remarks in Cairo Sunday, Kerry pointedly warned Gulf states in particular that “there is no safety margin whatsoever in funding a group like ISIL,” using the acronym for ISIS preferred by the US government.

Kerry said the US is especially concerned about funding destined for Syria and Iraq under the guise of charitable assistance but which “finds its way into the hands of terrorists.”

“We are obviously discouraging any kind of support to entities where it is unsure where the money is going,” Kerry said, “and that goes [for] any government, any charity, any individual.”

Kerry may be able to convince the region’s Sunni Arab regimes that they have no interest in seeing a group like ISIS remain in control of a large swath of Syria and Iraq. But he’s likely to have a much harder time building support for the beleaguered Iraqi government – especially if Maliki remains at its helm.