Turkish soldiers, right, and Turkey-backed opposition fighters stand atop a building next to their flags in Syrian town of Ras al Ayn, northeastern Syria, Wednesday, Oct. 23, 2019. Turkish media reports say Turkish troops and their allied Syrian opposition forces are securing a town in northeast Syria after Syrian Kurdish fighters pulled out of the area.(Ugur Can/DHA via AP)

AKCAKALE, Turkey (AP) — Russian military police began patrols on part of the Syrian border Wednesday, quickly moving to implement an accord with Turkey that divvies up control of northeastern Syria. The Kremlin told Kurdish fighters to pull back from the entire frontier or else face being "steamrolled" by Turkish forces.

Turkish President Recep Tayyip Erdogan echoed those warnings, saying his military would resume its offensive against Kurdish fighters if the new arrangements are not carried out.

Erdogan and Russian President Vladimir Putin reached an agreement Tuesday that would transform the map of northeast Syria, installing their forces along the border and filling the void left by the abrupt withdrawal of American troops. The Kurdish fighters, who once relied on the U.S. forces as protection from Turkey, were given a deadline of next Tuesday evening to pull back from border areas they have not already left.

Claiming success, U.S. President Donald Trump said the cease-fire between Turkey and the Syrian Kurds will be permanent . He said nearly all U.S. troops will be leaving Syria but some will remain to safeguard oil fields now in Kurdish hands.

"We've saved the lives of many, many Kurds," he said, although Trump essentially opened the way for Turkey's Oct. 9 invasion of northeastern Syria when he ordered U.S. troops to step aside.

Iraq, meanwhile, closed the door on the U.S. military's attempt to keep the troops leaving Syria on its soil. Iraqi Defense Minister Najah al-Shammari told The Associated Press that those troops were only "transiting" Iraq and would leave within four weeks, heading either to Kuwait, Qatar or the United States.

Al-Shammari spoke after meeting with U.S. Defense Secretary Mark Esper, who earlier this week had said the American forces from Syria would remain in Iraq to fight the Islamic State group. Iraq's military quickly said they did not have permission to do so.

The clumsy reversal underscored the blow to U.S. influence on the ground in the wake of Trump's order for U.S. troops to leave Syria. Those forces were allied with the Kurdish-led fighters for five years in the long and bloody campaign that brought down the Islamic State group in Syria.

Now, a significant swath of the territory they captured is being handed over to U.S. rivals , and the Kurds have been stung at being abandoned by their allies to face the Turkish invasion launched on Oct. 9.

The Kremlin pointedly referred to that abandonment as it told the Kurds to abide by the Russian-Turkish accord.

"The United States was the closest ally of the Kurds during the last few years, and in the end the U.S. ditched the Kurds and effectively betrayed them," leaving them to fight the Turks, Kremlin spokesman Dmitry Peskov said, according to Russian newswires.

"It's quite obvious that if the Kurdish units don't withdraw with their weapons then Syrian border guards and Russian military police will have to step back. And the remaining Kurdish units will be steamrolled by the Turkish army," he said.

The Kurds have enjoyed self-rule in the northeast ever since Syria's central government had to pull its forces out of the area seven years ago to battle rebels elsewhere at the height of the country's civil war. With the subsequent alliance with the U.S., the Kurdish fighters had hoped to give their autonomy ambitions further weight.

Turkey considers the Kurdish fighters terrorists because of their links to Kurdish insurgents in Turkey. It has demanded they retreat from the entire border region, creating a "safe zone" where Turkey could also settle some of the 3.6 million Syrian refugees on its soil.

Ankara would gain that goal under the new accord with Moscow, along with the agreement last week with the U.S. that put a cease-fire in place.

Kurdish forces completed withdrawing on Tuesday from a stretch of territory 120 kilometers (75 miles) wide along the border and 30 kilometers (19 miles) deep between the towns of Ras al-Ayn and Tal Abyad. That pullback, allowing Turkish-backed forces to take over, was required under the U.S.-Turkish accord.

The new agreement with Russia allows Turkey to keep sole control over that area.

On Wednesday, Turkish-backed Syrian fighters in Ras al-Ayn unfurled the flags of their forces and Turkey on the roof of a building that had reportedly been the Kurdish fighters' headquarters, according to footage aired on the Turkish channel NTV. The fighters and Turkish soldiers used heavy machinery to close tunnels built by the Kurds, Turkish media said.

For the rest of the northeastern border, the deal calls for Russian and Syrian government forces to move in to ensure the Kurdish fighters leave. Then after the deadline runs out Tuesday, Turkish and Russian forces will jointly patrol a strip 10-kilometers (6 miles) deep along the border.

The Russian Defense Ministry said a convoy of military police had crossed the Euphrates River and deployed in the Syrian border town of Kobani.

"The military police will help protect the population, maintain order, patrol the designated areas and assist in the withdrawal of Kurdish units and their weapons 30 kilometers away from the border," it said.

The Turkish military said it would not resume its offensive "at this stage" after the U.S.-brokered cease-fire expired Tuesday night. However, Foreign Minister Mevlut Cavusoglu said that Turkish forces would "neutralize" any Syrian Kurdish fighters they come across in areas that Turkey now controls.

President Erdogan said the attack would start again if the Kurdish pullback does not take place.

"Whether its our agreement with the United States or with Russia, if the promises given are not carried out, there will be no change concerning the steps we need to take," he told journalists, according to the newspaper Hurriyet.

Erdogan said he had also asked Putin what would happen if the Syrian Kurdish fighters donned Syrian army uniforms and remained in the border area. Putin responded by saying that he would not let that happen, Erdogan said.

Cavusoglu, Turkey's foreign minister, said the deal with Russia would continue until a lasting political solution for Syria is reached. He also said that Turkey agreed not to conduct joint patrols in the city of Qamishli at the eastern end of the border, because of Russian concerns they could lead to a confrontation between Turkish troops and Syrian government forces in the area.

____

Fraser reported from Ankara. Vladimir Isachenkov in Moscow and Qassim Abdul-Zahra and Lolita C. Baldor in Baghdad contributed.

In this photo taken from the Turkish side of the border between Turkey and Syria, in Akcakale, Sanliurfa province, southeastern Turkey, Syria's opposition flag flies on a pole in Tal Abyad, Syria, Wednesday, Oct. 23, 2019. Russian media reports say Russian military police have started patrols in northern Syria as a Turkish-Russian agreement giving Syrian Kurdish fighters 150 hours to withdraw from almost the entire northeast border region of Syria came into effect. (AP Photo/Lefteris Pitarakis)
Iraqi Defense Minister Najah al-Shammari, center right, and U.S. Defense Secretary Mark Esper, center left, stand for their country's national anthems during a welcome ceremony at the Ministry of Defense, Baghdad, Iraq, Wednesday, Oct. 23, 2019. Esper has arrived in Baghdad on a visit aimed at working out details about the future of American troops that are withdrawing from Syria to neighboring Iraq. (AP Photo/Hadi Mizban)
How Syria might look following implementation of the Russia-Turkish deal.;
A Turkish soldier mans an outpost at the border with Syria in Akcakale, Sanliurfa province, southeastern Turkey, Wednesday, Oct. 23, 2019. Russian media reports say Russian military police have started patrols in northern Syria as a Turkish-Russian agreement giving Syrian Kurdish fighters 150 hours to withdraw from almost the entire northeast border region of Syria came into effect. (AP Photo/Lefteris Pitarakis)
Turkish soldiers secure in Syrian town of Ras al Ayn, northeastern Syria, Wednesday, Oct. 23, 2019. Turkish media reports say Turkish troops and their allied Syrian opposition forces are securing a town in northeast Syria after Syrian Kurdish fighters pulled out of the area.(Ugur Can/DHA via AP)
Russian President Vladimir Putin, right, and Turkish President Recep Tayyip Erdogan look at each other during a joint news conference after their talks in the Bocharov Ruchei residence in the Black Sea resort of Sochi, Russia, Tuesday, Oct. 22, 2019. Erdogan says Turkey and Russia have reached a deal in which Syrian Kurdish fighters will move 30 kilometers (18 miles) away from a border area in northeast Syria within 150 hours. (Alexei Druzhinin/Sputnik Kremlin Pool Photo via AP)
Syrian government forces deploy near the town of Tal Tamr, north Syria, Tuesday, Oct. 22, 2019. Russia and Turkey announced an agreement Tuesday to jointly patrol almost the entire northeastern Syrian border after the withdrawal of Kurdish fighters, cementing the two countries' power in Syria in the wake of President Donald Trump's abrupt withdrawal of U.S. forces. (AP Photo/Baderkhan Ahmad)
In this photo taken from the Turkish side of the border between Turkey and Syria, in Akcakale, Sanliurfa province, southeastern Turkey, a view of the town of Tal Abyad, Syria, Wednesday, Oct. 23, 2019.  Russian media reports say Russian military police have started patrols in northern Syria as a Turkish-Russian agreement giving Syrian Kurdish fighters 150 hours to withdraw from almost the entire northeast border region of Syria came into effect. (AP Photo/Lefteris Pitarakis)
A Turkish flag on a hilltop at the Turkey-Syria border in the town of Ceylanpinar, Sanliurfa province, southeastern Turkey, Wednesday, Oct. 23, 2019, overlooking the town of Ras al-Ayn, Syria. Russian media reports say Russian military police have started patrols in northern Syria as a Turkish-Russian agreement giving Syrian Kurdish fighters 150 hours to withdraw from almost the entire northeast border region of Syria came into effect. (AP Photo/Lefteris Pitarakis)
Iraqi Defense Minister Najah al-Shammari, right, and U.S. Defense Secretary Mark Esper, left, stand for their country's national anthems during a welcome ceremony at the Ministry of Defense, Baghdad, Iraq, Wednesday, Oct. 23, 2019. Esper has arrived in Baghdad on a visit aimed at working out details about the future of American troops that are withdrawing from Syria to neighboring Iraq. (AP Photo/Hadi Mizban)
Iraqi Defense Minister Najah al-Shammari, center right, and U.S. Defense Secretary Mark Esper, center left, stand for their country's national anthems during a welcome ceremony at the Ministry of Defense, Baghdad, Iraq, Wednesday, Oct. 23, 2019. Esper has arrived in Baghdad on a visit aimed at working out details about the future of American troops that are withdrawing from Syria to neighboring Iraq. (AP Photo/Hadi Mizban)
Syrian government forces deploy near the town of Tal Tamr, north Syria, Tuesday, Oct. 22, 2019. Russia and Turkey announced an agreement Tuesday to jointly patrol almost the entire northeastern Syrian border after the withdrawal of Kurdish fighters, cementing the two countries' power in Syria in the wake of President Donald Trump's abrupt withdrawal of U.S. forces. (AP Photo/Baderkhan Ahmad)
Iraqi Defense Minister Najah al-Shammari speaks to journalists after his meeting with U.S. Defense Secretary Mark Esper, in Baghdad, Iraq, Wednesday, Oct. 23, 2019. U.S troops withdrawing from northeastern Syria to Iraq are