MOSCOW — President Bashar al-Assad of Syria paid a surprise visit to Russia on Thursday and was told by President Vladimir V. Putin that Russia expected “foreign armed forces” to pull out of Syria as a peace process began.

It was not immediately clear which foreign troops Mr. Putin referred to, as Russia, Iran, the United States and other nations have forces in the country. Mr. Putin said such a withdrawal would be part of a settlement of the country’s long civil war.

Both Iran and Russian forces are fighting on Mr. Assad’s side in Syria. If Mr. Putin was pointing to Iran’s military presence in Syria — which this month flared into an exchange of hostilities with Israel — his comment could suggest a Russian role in preventing Iran from becoming entrenched there.

Mr. Putin noted that the Syrian Army had won “significant victories and successes” in the war, according to the Tass news agency, and attention should turn to humanitarian aid and a political settlement.