ANKARA, Turkey – Russia and Iran expressed on Monday their growing frustration with extremists in northwest Syria, pitting them against Turkey, which fears renewed fighting could unleash millions of migrants onto its borders.

Russian President Vladimir Putin and Iran's Hassan Rouhani both said at a meeting in the Turkish capital with President Recep Tayyip Erdogan that their 2018 accord to clear the province of Idlib, the last rebel bastion, didn't go as planned and that Islamic militants have gained ground.

Although the two leaders stopped short of directly calling on their host to do more against the militants, their growing expectations from Ankara for help in Idlib puts them on a collision course with Erdogan. The Turkish president warned against an outbreak of violence in the area, which he said could affect as many as 4 million Syrians.

"It's clear that Turkey can't shoulder the burden of migrants on its own," Erdogan said during a news conference with Putin and Rouhani. "It's impossible to withstand another flow of migrants."

Pacifying Idlib would allow President Bashar Assad to consolidate control over all but the oil-rich northeastern part of Syria, setting the stage for reconciliation and reconstruction by ending the worst of the fighting. Putin and Rouhani said the de-escalation zone in Idlib should not be used as a shelter by the extremists. "We need to take additional steps together to completely eliminate the terrorist threat," the Russian leader said.

While Russia feels it has the upper hand over Turkey, which has military observers stationed in the Idlib area, it can't launch a full-scale offensive without Ankara's go-ahead, said Alexei Malashenko, senior analyst at the Berlin-based Dialogue of Civilizations research group co-founded by a Putin ally. "If this is agreed with the Turks, they will allow military actions in certain areas."

Erdogan, however, is determined to avoid an influx of Syrians fleeing an expected Russian-backed offensive on the rebel stronghold. Turkey already hosts 3.6 million Syrians who escaped the civil war.

Turkey says 500,000 Syrians have already hunkered down just across the border, and as fighting in Idlib has intensified in recent weeks, the number of migrants entering Europe from Turkey has grown. If the fighting gives way to an all-out offensive, Turkey has said it will block Syrians from entering.

Still smarting after the ruling party's loss of Turkey's two biggest cities in local elections in June, and facing mounting criticism over the cost of hosting Syrians, Erdogan wants to find a way to send some migrants back.

An ideal area to relocate as many as 3 millions refugees is northern Syria, where Turkey wants to create a buffer zone by pushing away Syrian Kurdish militants, Erdogan said. Turkey reached an agreement with the U.S. last month to that end but progress is scarce. Should the deal fail to yield its intended results, Turkey will act unilaterally to create what it says will be a "secure zone," Erdogan said.

"Erdogan's plan to relocate Sunni refugees along the border area is part of his push to confront Kurdish influence on Turkey's doorstep," said Nihat Ali Ozcan, a strategist at the Economic Policy Research Foundation in Ankara.

Perhaps the only bright spot Russia, Turkey and Iran could agree on was that the creation of a constitutional committee, a key objective in their efforts to stabilize the war-torn Syria. The countries agreed on who would take part in the committee, which should pave the way for substantial talks on a new constitution, the leaders said.

It marks Turkey's strengthening alliance with Russia, where the two countries work side by side in Syria despite deep differences on key issues, such as Idlib. But there are larger forces at play in Ankara's growing detente with Moscow, such as the near-constant battle of wills with the U.S., Turkey's partner in NATO.