Beirut • Turkey launched airstrikes and fired artillery across its border into northeastern Syria on Wednesday to open a military operation aimed at flushing out a U.S.-backed militia, Turkish and Syrian officials said.

The Turkish attack came amid a flurry of confusing policy statements from the White House, which on Sunday acquiesced to the operation, agreeing to move U.S. forces out of the way, but on Wednesday, hours after it began, condemned it.

“The United States does not endorse this attack and has made it clear to Turkey that this operation is a bad idea,” President Donald Trump said in a statement Wednesday.

Turkish fighter jets streaked through the sky over Syrian towns, while explosions from artillery shells boomed, causing traffic jams of terrified civilians fleeing south in trucks piled high with their possessions and children. At least two civilians were killed and others were wounded, a militia spokesman and local journalists said.

Turkey’s long-planned move to root out U.S.-allied Kurdish forces in northeastern Syria has accelerated rapidly since Trump gave the operation a green light in a call with President Recep Tayyip Erdogan of Turkey on Sunday.

The operation could open a dangerous new front in Syria’s 8-year-old war, pitting two U.S. allies against each other and raising the specter of sectarian bloodletting. Even before it began, it had set off fierce debates in Washington, with members of Congress accusing Trump of betraying the militia that fought beside the United States to defeat the Islamic State group.

“Pray for our Kurdish allies who have been shamelessly abandoned by the Trump administration,” Sen. Lindsey Graham, R-S.C., usually a staunch Trump ally, wrote on Twitter. “This move ensures the reemergence of ISIS.”

Trump insisted Tuesday that “in no way have we abandoned the Kurds,” and Wednesday said he firmly opposed the operation.

“Turkey,” he added, “has committed to protecting civilians, protecting religious minorities, including Christians, and ensuring no humanitarian crisis takes place — and we will hold them to this commitment.”

The United States withdrew from 50 to 100 troops from the border area in advance of the operation, and U.S. military officials said that the U.S. was not providing assistance to either side.

Erdogan said the operation aimed to “prevent the creation of a terror corridor across our southern border” but provided no other information about whether Turkish ground troops had entered Syria or how far they would go.

The operation’s scope was vast, with strikes hitting in or near at least five towns along a stretch of more than 150 miles of the Syrian-Turkish border.

The most intensive strikes were near Tel Abyad and Ras al Ain, the two towns that U.S. forces withdrew from Monday. But they also targeted Kobani and Qamishli, where one strike left a building in flames and a dead body on the sidewalk, according to a video shot by a local journalist.

“There is a huge panic among people of the region,” a militia spokesman, Mustafa Bali, wrote on Twitter.

“There is a state of fear and terror among the people here, and the women and children are leaving the town,” said Akrem Saleh, a local journalist reached by phone in Ras al Ain. Many of the men were staying at home because they feared that Syrian rebels backed by the Turks would loot them if they found them empty.

Saleh and Bali said that two civilians had been killed in a nearby village by a Turkish strike.

The bombings sound of bombardment shook the town of Akcakale, Turkey, just yards across the border from Tel Abyad. Schools were closed, and children played in the streets, waving flags and cheering a convoy of armored personnel carriers heading to the border.

Loudspeakers blared Ottoman martial music interspersed with stern announcements urging people not to gather in large groups and to stay away from houses facing the border.

“All day they were announcing,” said Fehima Kirboga, 46, as she sat with a relative on the sidewalk in the cool of the evening. “We are very anxious, but where can we go?”

Erdogan had been threatening to send troops into northeastern Syria to uproot the militia, which the United States has partnered with for years to fight the Islamic State group. Turkey considers the militia a terrorist organization linked to a Kurdish guerrilla movement.

In an op-ed in The Washington Post, a government spokesman, Fahrettin Altun, wrote that Turkish forces, with their Syrian rebel allies, “will cross the Turkish-Syrian border shortly.”

“Turkey has no ambition in northeastern Syria except to neutralize a long-standing threat against Turkish citizens and to liberate the local population from the yoke of armed thugs,” he wrote.

The Syrian Democratic Forces, which is made up of the U.S.-allied Kurdish troops, said the area was “on the edge of possible humanitarian catastrophe” because of the Turkish incursion.

“This attack will spill the blood of thousands of innocent civilians because our border areas are overcrowded,” the group said in a statement.

The Kurdish-led administration that governs the area issued a call for “general mobilization” to fight the Turks.

“We call upon our people, of all ethnic groups, to move toward areas close to the border with Turkey to carry out acts of resistance during this sensitive historical time,” it said.

The U.S. military, which had been working with the SDF to fight remnants of the Islamic State in Syria, has cut off all support to the militia, two U.S. military officials said, speaking on condition of anonymity to discuss confidential military assessments.

One official said that U.S. warplanes and surveillance aircraft remained in the area to defend the remaining U.S. ground forces in northeast Syria but said they would not contest any Turkish warplanes attacking Kurdish positions.

Trump reiterated his opposition to U.S. military presence in the Middle East, writing on Twitter that “USA should never have been in Middle East.”

He said that Turkey should take control of captured Islamic State fighters from Europe whose countries had refused to take them back and who are were imprisoned in northeast Syria.

“Turkey is now responsible for ensuring all ISIS fighters being held captive remain in prison and that ISIS does not reconstitute in any way, shape or form,” he said in his statement, using an alternative name for the Islamic State.

Tens of thousands of Islamic State fighters and their families are in prisons and camps overseen by the SDF, whose leaders say there have been no discussions with the United States about handing over the facilities.

Turkey made efforts to win diplomatic support for its operation, informing the United States, Russia, Britain, NATO and the secretary-general of the United Nations, the Turkish Defense Ministry said.

NATO Secretary-General Jens Stoltenberg urged Turkey, a NATO member, “to act with restraint” and to ensure that “the gains we have made in the fight against ISIS are not jeopardized.”

Amélie de Montchalin, the French junior minister for European affairs, said that France, Germany and Britain were drafting a joint statement that would be “extremely clear about the fact that we very strongly, very firmly condemn” the Turkish offensive.

A number of countries, including Russia and Iran, both allies of President Bashar Assad of Syria, called for talks to calm the situation instead of military action.

The U.N. Security Council was to discuss the issue Thursday after requests by European members. Stoltenberg said he planned to meet with Erdogan on Friday.

A military coalition led by the United States partnered with a Kurdish militia beginning in 2015 to fight Islamic State extremists who had seized a territory the size of Britain that spanned the Syrian-Iraqi border.

That militia grew into the Syrian Democratic Forces and eventually took control of the areas liberated from the Islamic State, pushing it from its last foothold in Syria earlier this year.

But the partnership angered Turkey, which considers the militia a part of the Kurdistan Workers’ Party, or PKK, a Kurdish guerrilla movement that has been fighting the Turkish state for decades.

In recent days, Turkey has been preparing an incursion, with forces bused to the border and howitzers positioned behind dirt embankments, pointed at Syrian territory.

After a phone call with Erdogan on Sunday, the White House announced that Turkey would be sending forces into Syria and said the United States would move U.S. troops out of their way.

On Monday, U.S. soldiers withdrew from observation posts near the Syrian border towns of Tel Abyad and Ras al Ain, in the area where Turkey is expected to enter.

The commander of the SDF, Mazlum Kobani, told The New York Times on Tuesday that his forces would resist any attempt by Turkey to establish a foothold in Syria.

Kobani and a range of current and former U.S. officials have warned that a new fight with Turkey could pull his forces out of areas where the Islamic State remains a threat, opening a void that could benefit President Bashar Assad of Syria and his Russian and Iranian backers, or the jihadis. U.S. officials said Tuesday that the militia was already beginning to leave some of their counterterrorism missions against the Islamic State.

Trump has repeatedly sought to withdraw the roughly 1,000 U.S. troops posted in northeastern Syria as part of his long-standing promise to extricate the United States from what he deems “endless wars.”

But he has faced fierce pushback from others in Washington, including from Republican lawmakers.

On Tuesday, Trump sought to clarify his position, writing on Twitter that the United States had “in no way abandoned the Kurds,” but that it also had good trade relations with Turkey.

He warned that “any unforced or unnecessary fighting by Turkey will be devastating to their economy,” but did not explain what sort of action would cross the line.

Graham warned Turkey on Tuesday not to proceed with the operation.

“To the Turkish Government: You do NOT have a green light to enter into northern Syria,” he wrote. “There is massive bipartisan opposition in Congress, which you should see as a red line you should not cross.”