Velayati said that he would deliver messages from Ayatollah Khamenei and Iranian President Hassan Rouhani to Russian President Vladimir Putin.
"After Mr. Trump's strategic mistake in unilaterally withdrawing, the Islamic Republic of Iran made a decision to send special envoys to different countries conveying the message of high officials of Iran containing our stances, positions, and approaches towards this arrogant and illegal move of the US", Iranian Foreign Ministry spokesman Bahram Ghasemi said in describing the Wednesday visit of Velayati to Moscow.
According to Velayati, Iran would immediately withdraw its "military advisers" from Syria and Iraq only if their governments wanted it to.
Ali Akbar Velayati is Ayatollah Ali Khamenei's leading adviser.
"We will counter the Americans powerfully", he said.
He further referred to demands by U.S. officials that Iranians should exit from Syria and Iraq, saying that the Islamic Republic is not present in the Arab countries upon the US's request so as to leave at Washington's demand.
Velayati expressed his hope that his visit to Moscow and his talks with the Russian president and officials would be a turning point for strategic relations between the two countries and that Putin would soon visit Tehran.
On Friday, however, the Israeli press reported that Moscow had turned down the request.
The high-level talks precede Monday's summit in Helsinki between Mr Putin and US President Donald Trump, who are set to discuss the Iranian presence in Syria. Israel captured the western part of Golan Heights from Syria in 1967 and repelled Syrian forces that tried to take it back in 1973, when Bashar Assad's late father, Hafez Assad, led the country.
Velayati also addressed the issue of Syria, saying military and political cooperation would ensure the support of the "legal governments of Syria and Iraq".
The Israeli military downed a suspected Syrian military drone Friday as it reportedly flew over the occupied Golan Heights in southwestern Syria, just one day after the government reclaimed a city that helped spark the country's devastating seven-year civil war.
He added that if those two countries declare they do not need Iran's presence, the Islamic Republic will depart from there.
"Iran and Russia's presence in Syria will continue to protect the country against terrorist groups and America's aggression".
He also praised Russia's support for Iran at the worldwide level, especially in the United Nations, adding that bilateral relations in the defense, political, economic and nuclear fields indicate a long-term cooperation program between the two countries.