IRBIL, Iraq — Iraq appeared closer to its long-predicted disintegration Thursday as Kurdish leaders ordered steps to hold a referendum “as soon as possible” on self-rule for their oil-rich territory and Islamist extremists improved their military position by seizing more territory across the border in Syria.

U.S. military officials, offering their first public assessment of the situation, said it will take decades to subdue the threat posed by the Islamic State, which seized Iraq’s second largest city, Mosul, on June 10, then raced southward 200 miles, coming to within an hour’s drive of Baghdad before its advance was halted.

On Sunday, it declared an Islamic caliphate on the land it controls in Syria and Iraq.

Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, told reporters in Washington that the Islamic State’s rapid advance had “stretched” its resources. Still, he said he believed that the world community would have to wrestle with the organization for “a generation or two.”

He also labeled as “bleak” the future for a united Iraq unless there is reconciliation between Sunni Arabs, who have supported the Islamic State’s advances, and majority Shiite Arabs, who run the country’s government. Dempsey said Iraq’s political leaders, an apparent reference to embattled Shiite Prime Minister Nouri al-Maliki, have to find a way “to separate Sunnis” from the Islamic State, with whom they’ve partnered “because they have zero confidence in the ability of Iraq’s politicians to govern.”

He said the United States’ first task “is to determine whether we have a reliable Iraqi partner that is committed to growing their country into something that all Iraqis will be willing to participate in.”

“If the answer to that is no, then the future is pretty bleak,” Dempsey said.

The impact of the Islamic State’s success in Iraq became clear Friday in Syria, where Islamist fighters took over five towns in the Deir el Zour region without a fight.

The development allowed the Islamic State to secure its rear flanks, where it had been battling other Syrian rebel groups, and gain control over much of Syria’s oil and natural gas production – an economic boon for an organization that already has captured booty in Iraq.

But it was what took place in Irbil on Thursday that was most likely to cement Iraq’s eventual partition into regions along ethnic and sectarian lines.

Massoud Barzani, the president of the Kurdistan Regional Government, buoyed by Israeli Prime Minister Benjamin Netanyahu’s public support for independence, took the first legal steps Thursday toward holding a referendum on self-rule, instructing the regional Parliament to pass a bill setting up an election commission “as soon as possible.”

“We have international support for independence, and those who do not support us do not oppose us,” he said, according to an official statement.

Barzani also announced that Kurdish military forces would not withdraw from Kirkuk and other disputed areas outside Kurdistan’s borders that it occupied following the collapse of the Iraqi army.

“It is time to decide about our self-determination and not to wait for other people to decide about us,” he said, according to an audio of the closed-door remarks obtained by The Associated Press.