Turkish President Tayyip Erdogan expressed concern about U.S. and Russian bases in Syria on Monday and said if countries truly believed a military solution was impossible they should withdraw their troops.

On Saturday, Putin and U.S. President Donald Trump said in a joint statement they would continue to fight Islamic State in Syria, but agreed that there was no military solution to the country's wider, six-year-old conflict.

"I am having trouble understanding these comments," Erdogan told reporters before flying to Russia for talks with President Vladimir Putin. "If a military solution is out of the question, then those who say this should pull their troops out.

"Then a political method should be sought in Syria, ways to head into elections should be examined... We will discuss these with Putin," he said.

Erdogan said both Moscow and Washington, which armed Syrian YPG Kurdish forces Ankara sees as allied to separatists fighting in southeastern Turkey, had set up bases. He suggested neither country would be pulling out 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.

"The United States has 13 bases in Syria in total and Russia has five others."

The YPG has said Washington has established seven military bases in areas of northern Syria controlled by the YPG or U.S.-backed forces fighting President Bashar al-Assad's troops.

The U.S.-led coalition says it does not discuss the location of its forces.

Russia has been a strong supporter of Assad, whose removal Erdogan has demanded, and Moscow's military intervention two years ago helped turn the conflict in the Syrian president's favour.

Turkish troops have also fought in Syria to halt the advance of Kurdish YPG forces along its frontier.