ANKARA, Turkey — Kurdish fighters completed their pullout from a zone along the Syrian border as required under a U.S.-brokered cease-fire deal hours before it was set to expire Tuesday, U.S. and Kurdish official said, as the leaders of Turkey and Russia sought to work out the fate of the border region.

Turkey had threatened to relaunch its offensive if the withdrawal was not carried out. A senior Kurdish official, Redur Khalil, said that even after the Kurdish pullout, Turkish troops and their allies were continuing military operations in northeastern Syria outside the withdrawal zone. Ankara has agreed to the specified zone but Turkish officials said they still want to clear Kurdish fighters from their entire shared border.

The Kurdish-led forces notified the White House of the completed withdrawal in a letter, a senior Trump administration official said, speaking on condition of anonymity because the contents of the letter have not yet been publicly disclosed.

The United States, meanwhile, ran into a new hitch in getting its troops out of Syria, with neighboring Iraq's military saying Tuesday that the American forces did not have permission to stay on its territory.

The Iraqi announcement seemed to contradict U.S. Defense Secretary Mark Esper, who a day earlier said the forces leaving Syria would deploy in Iraq to fight the Islamic State group.

The conflicting signals underscored how the United States has stumbled from one problem to another after President Donald Trump abruptly ordered their withdrawal. Amid fears the Americans' departure will revive IS, Esper is considering keeping some troops in Syria to protect oil fields held by Kurdish-led fighters, backing away from the full withdrawal first touted by Trump.

After the Iraqi statement, Esper said he would speak to the Iraqi defense minister on Wednesday and underlined that the U.S. has no plans to keep the troops in Iraq "interminably" and intends to "eventually get them home."

The U.S. pullout opened the door for Turkey to launch its offensive against Kurdish fighters on Oct. 9. After a storm of criticism, Washington moved to broker a five-day cease-fire that was set to expire Tuesday night.

Meanwhile, Russia has stepped into the void to strengthen its role as a power broker in Syria. Turkish President Recep Tayyip Erdogan and Russia's Vladimir Putin held talks in the Black Sea town of Sochi just hours before the cease-fire was set to expire.

The talks are likely to be crucial in determining arrangements along the Syrian-Turkish border, where Ankara demands a long "safe zone" cleared of Kurdish fighters. Footage from the meetings in Russian media showed the two leaders looking over maps of Syria.

Seeking protection after being abandoned by the Americans, the Kurds turned to the Syrian government and its main ally, Russia. The Syrian army has advanced into parts of the area, and Russia deployed its troops in some areas to act as a buffer force.

Russia has powerful sway on all sides. Turkey has suggested it wants Russia to persuade the Syrian government to cede it control over a major chunk of territory in the northeast. The Kurds are hoping Russia can keep Turkey out and help preserve some of the autonomy they carved out for themselves during Syria's civil war.

Syrian President Bashar Assad has vowed to reunite all the territory under Damascus' rule. On Tuesday, Assad called Erdogan "a thief" and said he was ready to support any "popular resistance" against Turkey's invasion.

"We are in the middle of a battle and the right thing to do is to rally efforts to lessen the damages from the invasion and to expel the invader sooner or later," he told troops during a visit to the northwestern province of Idlib.

The immediate question was the fate of the U.S.-brokered cease-fire, which was to run out at 10 p.m. Tuesday evening.

Erdogan said 1,300 Syrian Kurdish fighters had yet to vacate a stretch of the border as required under the deal. He said 800 fighters had left so far. The Kurdish-led force has said it will carry out the pullout.

If it doesn't, Erdogan warned Tuesday, "our offensive will continue from where it left off, with a much greater determination."

"There is no place for the (Kurdish fighters) in Syria's future. We hope that with Russia's cooperation, we will rid the region of separatist terror," he said.

Under the accord, the Kurdish fighters are to vacate a stretch of territory roughly 75 miles wide and 20 miles deep between the Syrian border towns of Tal Abyad and Ras al-Ayn.

But that leaves the situation in the rest of the northeastern border unclear. Currently, other than the few places where Syrian troops have deployed, they are solely in the hands of the Kurdish-led fighters — a situation Ankara has repeatedly said it cannot tolerate. Turkey considers the fighters terrorists, because of their links to Kurdish insurgents inside Turkey.

Turkey wants to control a "safe zone" extending more than 250 miles along the border, from the Euphrates River to the Iraqi border. There, it plans to resettle about 2 million of the roughly 3.6 million Syrian refugees currently living in Turkey.

Russia sent a new signal to Turkey about the need to negotiate directly with Assad. Kremlin spokesman Dmitry Peskov emphasized that only Damascus could authorize the Turkish troop presence on the Syrian territory.

Assad's visit Tuesday with Syrian forces in Idlib province underlined Damascus' goal of regaining the border. Idlib is adjacent to a border enclave that Turkey captured several years ago in another incursion. Turkey also has observation points inside Idlib, negotiated with Russia, to monitor a cease-fire there between the government and opposition fighters and jihadi groups.

Erdogan is "a thief," Assad told the troops. "He stole the factories and the wheat and the oil in cooperation with Daesh (the Islamic State group) and now is stealing the land."

He said his government had offered clemency to Kurdish fighters — whom it considers separatists — to "ensure that everyone is ready to resist the aggression" and fight the Turkish assault.

Syrian state media reported, meanwhile, that government forces entered new areas in Hassakeh province at the far eastern end of the border, under the arrangement with the Kurds.

Turkey's incursion into Syria has led to an international outcry, which has in turn enraged Erdogan, who has accused his NATO allies of not standing by Turkey.

European Council President Donald Tusk condemned the incursion and called on Turkey — which is a candidate for EU membership — to pull out troops.

"No one is fooled by the so-called cease-fire," Tusk told EU lawmakers. Any course other than a Turkish withdrawal "means unacceptable suffering, a victory for Daesh (the Islamic State group), and a serious threat to European security."

German Defense Minister Annegret Kramp-Karrenbauer proposed the establishment of an internationally controlled security zone in Syria, "with the inclusion of Turkey and Russia."