Turkish President Recep Tayyip Erdogan has suggested Russia and the United States should pull their troops out of war-torn Syria after their leaders - Vladimir Putin and Donald Trump - said there was "no military solution" to the country's long-running conflict.

"I am having trouble understanding these comments," Erdogan was quoted by reporters as saying on Monday, before he flew out to Russia's coastal city of Sochi for talks with Putin.

"If a military solution [in Syria] is out of the question, then those who say this [Russia and the US] should pull their troops out ... and steps for a political solution should be taken," he said.

Erdogan's comments came two days after the Kremlin released a statement, issued on the sidelines of an Asia-Pacific summit in Vietnam, in which Putin and Trump agreed there was no military solution to the conflict in Syria.

They also called on all parties to take part in the Geneva process - diplomatic efforts to end Syria's conflict under the auspices of the United Nations.

Russia has been a major backer of Syrian President Bashar al-Assad, while the US has been supporting the Syrian YPG Kurdish forces on the ground.

In his reported comments, Erdogan said neither Russia nor the US would be pulling out of Syria soon.

"The United States said it would completely leave Iraq, but it didn't. The world is not stupid, some realities are being told differently and practised differently," he said.

Commenting on Erdogan's reaction to the Turkish president's remarks, Marwan Bishara, Al Jazeera's senior political analyst, said: "The question probably on Erdogan's mind is 'why am I not the one sponsoring the talks in Geneva?'

"The whole idea of this superpower logic, when it comes to Syria, we all know that Iran and Turkey are playing a far greater role and Turkey is not on the same wave as the US [in Syria]," added Bishara.

Sochi talks

Turkey, Russia and Iran have been brokering Syria talks in Kazakhstan's capital, Astana - a separate process than the one in Geneva.

Just like Moscow, Tehran is a major military backer of al-Assad, whereas Turkey supports certain rebel groups seeking to overthrow him.

The Syrian conflict and bilateral trade were expected to be high on the agenda during the Putin-Erdogan meeting in Sochi, the fourth this year.

Al Jazeera's Rory Challands, reporting from the Black Sea city, said Erdogan's visit was aimed at mending Turkey's "battered" relationship with Russia, something that has taken years to repair.

"They're still trying to rebuild a relationship that's taken a battering in recent times," he said.

"It started when the Turks shot down a Russian plane over southern Turkey, near the Syrian border, two years ago. Following that, the Russians put in place a whole host of restrictions, a restriction of citizen movement, embargoes etc - they're trying to repair that.

"The relationship is now nearly back to how it was before the turmoil started."

Erdogan, however, still has concerns over Putin and Trump's comments and is also concerned by what's unfolding in Idlib province, our correspondent said.

"Idlib is one of the most complicated battle spaces in Syria. The Turkish-backed Free Syrian Army is squashed in together with much more hardline elements, groups linked to al-Qaeda and the group formerly known as the Nusra Front.

"The Turks are trying to split these elements apart but the area is still under bombardment from regime forces, and the Turks aren't happy about that.

"The Turks are also concerned about their perennial problem - the Kurds," Challands said.

Turkish troops pushed into Syria in August of last year in an effort to push the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group away from its border and to stop the advance of Kurdish fighters.

"Russia has a fairly open dialogue with the YPG which Turkey considers a terrorist group, and Erdogan has raised concerns about that here in Sochi," Challands added.