Addressing the UN General Assembly, Foreign Minister Walid al-Moualem, who serves as well as Syria's deputy prime minister, also called on Syrian refugees to come home, even though the country's war is now in its eighth year.
Moualem said the foreign forces were on Syrian soil illegally, under the pretext of fighting terrorism, and "will be dealt with accordingly."
"They must withdraw immediately and without any conditions," he told the assembly.
Russia vows no safe passage for Syria militants in Idlib
Moualem insisted that the "war on terror is almost over" in Syria, where more than 360,000 people have died since 2011, with millions more uprooted from their homes.
He said Damascus would continue "fighting this sacred battle until we purge all Syrian territories" of both terror groups and "any illegal foreign presence."
The United States has some 2,000 troops in Syria, mainly training and advising both Kurdish forces and Syrian Arabs opposed to President Bashar al-Assad.
US launches missiles at Assad's airbase in Syria
France has more than 1,000 troops on the ground in the war-wracked country.
On the issue of refugees, Moualem said the conditions were fine for them to return, and he blamed the international community for "spreading irrational fears" that prompted refugees to stay away.
"We have called upon the international community and humanitarian organizations to facilitate these returns," he said. "They are politicizing what should be a purely humanitarian issue."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ