Concrete tunnels made along the Turkish border are seen by the side of a road in the countryside of Hasaka, Syria. Kurdish authorities say the tunnels were made in preparation for a possible attack by the Turkish army.

WASHINGTON — The Trump administration has launched a last-ditch effort to head off a Turkish invasion of northeastern Syria that it expects will come within the next two weeks.

With tens of thousands of Turkish troops massed near the border, a high-level Defense Department delegation is presenting what U.S. officials describe as a final offer to address Turkey's concerns at a meeting Monday in Ankara. The Turkish defense ministry tweeted on Monday that the meetings were underway.

The meeting marks the climax of a years-long dispute between the two NATO allies over U.S. support for Syrian Kurdish fighters who have led the ground war against the Islamic State, but whom Turkey considers a terrorist threat to its own security. Kurdish-led victories against the militant group have effectively left them in control of much of the border area.

Failure of the U.S. effort could throw the war-devastated region into even deeper turmoil, endangering efforts to rout Islamic State remnants and President Donald Trump's determination to withdraw U.S. troops from Syria.

The U.S. proposal includes a joint U.S.-Turkish military operation to secure a strip south of the Syria-Turkey border that would be about 9 miles deep and 87 miles long from which the Kurdish fighters would be withdrawn.

The U.S. and Turkish militaries would destroy Kurdish fortifications and then jointly patrol the area, located in the middle third of the northeastern border stretching between the Euphrates River and Iraq. The other two-thirds would be cleared later.

Turkey has already rejected those parameters, insisting on a "safe zone" at least 20 miles deep and expressing a preference to control it alone. The Turkish government is also looking to establish areas that would allow the safe return of some of the more than 3.6 million Syrian refugees currently living in Turkey.

It is not the first time Turkey has threatened an invasion. But this time, the threat is real and imminent, according to U.S., Turkish, Kurdish and European officials, some of whom spoke on the condition of anonymity about the volatile situation.

"Now we are going to enter [Syria] east of the Euphrates," Turkish President Recep Tayyip Erdogan said Sunday at a ceremony opening a highway and hospital in the city of Bursa. "We have shared this with Russia and the United States," he added "We can only be patient for so long."

If Turkey refuses the U.S. entreaty, the administration has made clear that it cannot, under existing congressional authorities, intervene to protect the Kurdish fighters. The Kurdish People's Protection Units, or YPG in its Kurdish abbreviation, dominates the more than 60,000-strong army, called the Syrian Democratic Forces, that the United States equipped, trained and directed to defeat the Islamic State's self-declared caliphate.

Adding to the extreme tension over the issue, the administration is engaged in a separate conflict with Turkey over its purchase of a sophisticated Russian missile defense system, which already has caused the United States to cancel Turkey's participation in the manufacture and purchase of the F-35, the next generation American stealth aircraft.

U.S. law also requires Trump to impose economic sanctions on Turkey over the Russian purchase. Trump, to the bipartisan ire of Congress, has so far avoided implementing the mandate, at least in part to keep from destroying any chance of a deal over the Kurds.

At the same time, the Kurds have warned that a fight with Turkey may leave them unable to guard makeshift prisons in eastern Syria holding Islamic State prisoners. The militants — 8,000 Syrians and Iraqis, and about 2,000 from other countries — were captured during operations that led to the dismantling of the self-described caliphate earlier this year.

"Either we will fight" the Turks "or guard" the prisoners, said Aldar Xelil, a leading Kurdish politician in northeastern Syria. "We cannot do both together."

He said Kurdish forces, who were recently visited by Gen. Kenneth McKenzie, the head of the U.S. Central Command, had agreed with the United States to withdraw from a zone limited to three miles from the border.

"Honestly, we are not using ISIS prisoners as a card" to be played, said Xelil, who was interviewed in the Syrian border city of Qamishli. "But maybe we are going to lose control here. . . . These are not like formal prisons; some of them are just schools where we built a wall and converted it into a prison."

"If the ISIS members see that there is fighting and that Turkey has attacked . . . they will break the walls and flee," he said, using an acronym for the Islamic State.

In northeast Syria, the Kurdish administration is preparing for war with Turkey.

Roads in border towns and cities are scarred with freshly dug tunnels, and dozens of homes have been turned into shelters. Makeshift hospitals have been built underground.

The Kurds say they have no illusions about victory against the Turkish military. "If they enter, our territory will be destroyed," Xelil said.

The bigger problem

The conflict over the Kurds is a story of U.S. efforts to delay dealing with one problem — Turkey — to address what was considered a far bigger one — the Islamic State.

It also reflects the different imperatives of the U.S. military, which has considered the Kurds by far the most effective fighting force available to it in Syria, and the American diplomats responsible for explaining U.S. policy decisions to Ankara.

The U.S.-YPG alliance was formed when the Kurdish forces, aided by U.S. airstrikes, retook the border city of Kobane, and surrounding towns and villages, from the Islamic State in 2015.

Turkey considers the YPG and its Syrian political affiliate to be subgroups of Turkey's Kurdistan Workers' Party. For decades, the PKK, as it is known, has fought the Turkish military, initially to achieve an independent Kurdish state and more recently to gain a level of Kurdish autonomy inside Turkey.

The United States and Turkey have designated the PKK a terrorist organization, and Turkish-PKK clashes markedly increased in recent months. Turkey also considers the YPG a terrorist group, but the United States does not.

U.S. officials initially told Turkey that their alliance with the YPG was temporary and that the weapons they supplied to the Kurdish fighters to take back Kobane would be reclaimed. But those promises were quickly overtaken by the need to field an effective ground force against the militants in eastern Syria.

American diplomats avoided publicizing their contacts with the Kurds, but the U.S. military was eager to praise their battlefield prowess. More and more weapons were supplied — although not the artillery and other heavy weaponry the Turks have claimed — and U.S. commanders proudly posed with the fighters for photographs published on YPG social media.

Each picture further infuriated the Turks, as did the 2016 U.S.-backed takeover from the Islamic State of the city of Manbij, near the border and about 25 miles west of the Euphrates. The river had long been an informal dividing line between the U.S. fight against the Islamic State and the rest of Syria, where President Bashar Assad and his Russian and Iranian allies were battling Syrian opposition forces.

Although a U.S.-Turkish deal to remove the YPG from Manbij was eventually struck, its implementation has been slow and spotty.

Beginning in 2016, Turkish forces moved into western parts of northern Syria, in large part to prevent the U.S.-backed Kurds from uniting with other Syrian Kurdish groups and forming a solid line along the entire border. As it cracked down on the PKK north of the border, Turkey charged that the Syrian Kurds were lobbing mortar shells and artillery into Turkish territory. The Syrian Kurds said it was the Turks who were attacking them across the border.

The phone call

When Trump announced in December - after a phone call with Erdogan — that he was ordering the withdrawal of U.S. troops from Syria, the U.S. Syrian Kurdish allies said they feared that Turkey would increase its attacks against them.

In January, amid a backlash, Trump tweeted that the United States would "devastate Turkey economically if they hit Kurds." But he added: "Likewise, do not want the Kurds to provoke Turkey."

The withdrawal announcement was among the factors that led to the resignation of Trump's defense secretary, retired Gen. Jim Mattis, for whom a permanent replacement was not installed until Mark Esper's confirmation last month.

For the military, the ground campaign against the Islamic State in Syria — supported by U.S. and coalition airstrikes - has been among the most successful and lowest-cost U.S. operations in decades, although human rights groups have said the U.S. — led air war resulted in thousands of civilian casualties.

With no more than about 2,500 deployed at their highest level, most U.S. troops were far from the front lines and took only a handful of casualties over the years. But their presence was seen as a largely symbolic but effective bulwark against Syrian government, Russian and Iranian incursions into eastern Syria.

If it accomplished nothing else, the shock of Trump's announcement — which was eventually tempered with an agreement to slow-walk the U.S. withdrawal — has helped put the Departments of State and Defense in closer agreement on how to resolve the Turkey problem.

Secretary of State Mike Pompeo has pushed back against what largely had become a military-directed relationship, and the two bureaucracies have found common cause in dealing with the often-irascible Turks. Trump, with his eye on reelection, is seen internally as having no real objective except bringing home the troops but has also played a sometimes-useful role in placating Erdogan.

The U.S. force is now down to about 1,000 troops, a number of whom would be needed to conduct patrols with Turkish forces in the U.S.-proposed safe zone.

Syrian Kurds are hedging their bets. They are in communication with the Assad regime — where there is little room for rapprochement — and the Russians.

Russia is "suggesting a deal where we push the Americans out — and then they will stop the Turks," said Xelil, the Kurdish politician. "We told them: 'How are we going to kick the Americans out? Did we bring the Americans here?' "

Mekhennet and Loveluck reported from Qamishli, Syria. Kareem Fahim in Istanbul contributed to this report.