American warplanes were diverted from an offensive launched against the Islamic State last week by U.S.-backed rebels in Syria in order to bomb a more enticing target in Iraq, withdrawing air support at a critical moment and contributing to the failure of the rebel operation, according to U.S. officials familiar with the incident.

Aircraft assigned to provide cover for the offensive, launched June 28 to capture the eastern Syrian town of Bukamal, were ordered in the middle of the operation to leave the area and head instead to the outskirts of Fallujah, in neighboring Iraq, the officials said.

A large convoy of Islamic State fighters had been seen trying to escape across the desert after the city was recaptured by the Iraqi army, and U.S. commanders decided that the convoy represented a “strategic target,” said  Col. Chris Garver, a U.S. military spokesman.

The convoy was destroyed by the U.S. and British planes along with gunships and aircraft from the Iraqi air force, which began striking the long line of Islamic State vehicles before the U.S. Air Force arrived. Hundreds of Islamic State fighters were killed and scores of their vehicles were destroyed in one of the more spectacular single assaults against the militants in the nearly two-year-old war against them.

By that time, however, the fighters of the Pentagon-trained New Syrian Army were in retreat, beaten back by the Islamic State to their desert base more than 200 miles away at Tanf, on the Syrian-Iraqi border. The failure of the operation was a significant blow to the Pentagon’s Syria strategy of building a Syrian Arab force capable of taking on the Islamic State.

The diversion of air forces also calls into question whether the U.S. military and its coalition allies have committed enough resources to the war against the Islamic State, which is now being waged on multiple fronts across a large swath of territory in Syria and Iraq.

Defending the decision to withdraw air support from the battle in Syria, Garver said: “You have a finite number of resources and you try to get the biggest bang for buck that you can out of the resources you have. … Prioritization was given to one target over another.”

The U.S. military’s daily record of air strikes conducted in Iraq and Syria shows that eight strikes were conducted in Bukamal on the day the offensive was launched — but only one on the day it crumbled. For the bombing of the Fallujah convoy, the U.S. Air Force “put everything up in the air,” Garver said, including B-52 bombers and AC-130 Spectre gunships.

“The priority here appeared to be going after the target, going after the big shiny object,” said David Maxwell, a former Special Forces officer and the associate director of Georgetown University’s Security Studies Program, after being informed of the strikes. “It’s the manifestation of a mind-set of the last 15 years, of these drone strikes and Special Operations force raids, where we want to achieve immediate effects on the battlefield without thinking about what might fall to the wayside.”

The decision to attack the convoy left the New Syrian Army without air cover and struggling to maintain early gains in an operation that was already teetering on the brink of failure.

There were other reasons for the operation’s collapse, according to New Syrian Army fighters involved in the operation. They include failed hopes that residents of Bukamal would rise up to support the offensive. The New Syrian Army succeeded on the first day to seize a foothold  at a rudimentary airstrip outside the town. A rebel radio station, Bu Kamal Liberation Radio, broadcast appeals to the local population to stage an insurrection.

But the calls were not heeded, said Abdulsalam Muzil, a member of the Authenticity and Development Front, the rebel group that formed the New Syrian Army. “We put out messages on our radio station but it was difficult for people to join us because the Islamic state has an iron fist,” he said. “Also, now people are not listening to the radio so much because they consider it old-fashioned.”

The Islamic State soon counterattacked, pushing the rebel forces out of the town and back into the desert, where they were forced to drive back to their border garrison base.

The New Syrian Army initially said it lost two men in the fight, one who was killed in the ensuing gun battle and another who was captured and beheaded. The Islamic State displayed their brutalized bodies in a video, as well as quantities of captured weapons, including U.S. .50-caliber heavy machine guns. Three others later died in an ambush as the group retreated back across the desert.

New Syrian Army commanders said they noticed U.S. warplanes disappear from the skies overhead for a while during the battle, but they were unaware that the reason was the bombing of the Fallujah convoy. The air support later returned, said Muhammed Tallaa, the commander of the New Syrian Army, who has in the past criticized the meager support given by the U.S. military to his group.

The U.S.-backed forces sought after the event to portray the operation as hit-and-run attack — or “deep penetration raid” — behind enemy lines, and described it as a success. The Islamic State “is no longer safe in what was formerly one of their most secure areas,” the group said in a statement.

But the characterization did not match earlier statements, including by the United States, that the operation was aimed at capturing Bukamal.

“The announced purpose of this attack by the New Syrian Army … is to liberate Bukamal and cut [the Islamic State’s] military supply lines in the Euphrates Valley between Syria and Iraq,” said Garver during a news conference shortly before the offensive collapsed.

Garver said that operations at Bukamal are continuing, suggesting the offensive is not over yet. But the Islamic State is also on the attack: Tallaa, the commander of the New Syrian Army, said his men were coming under rocket fire at their desert base in Tanf late Wednesday night.

The small force never numbered more than 100 men, but was backed in the offensive by a different, CIA-backed group. The New Syrian Army comprises rebels drawn from the local population of Bukamal who were recruited mostly in Turkey in 2015, trained in Jordan and sent into Syria earlier this year with the goal of confronting the Islamic State.

But the force has always been vulnerable. A sizable percentage of the fighters were killed in an Islamic State suicide bombing in May, and in June it was bombed twice by the Russian air force, despite U.S. military attempts to halt the strikes.

The contingent had received training and support from the United States, Jordan and the United Kingdom before driving 10 hours across the Syrian desert to assault Bukamal, and its perceived defeat there is one more blow to a highly criticized Pentagon program that has produced only marginal battlefield gains despite a $500 million budget and an initial promise of churning out 5,000 trained fighters a year.

“Hanging out our supposed allies to dry doesn’t achieve much and undermines our legitimacy and credibility,” Maxwell said. “It’s hard to establish and maintain rapport with these organizations if we say one thing and do another.”

Liz Sly and Zakaria Zakaria reported from Irbil, Iraq. Mustafa Salim contributed from Baghdad. Karen DeYoung and Missy Ryan contributed from Washington.

Read more: