Military command said this was a strategic victory which secures oil and gas routes between the Damascus area and oilfields in eastern Syria
Syrian and allied forces, backed by Russian air strikes, drove Islamic State militants out of the town of al-Qaryatain on Sunday, Syria's military command said, after gradually encircling it over the past few days.
Surrounded by hills, al-Qaryatain is 100 km (60 miles) west of the ancient city of Palmyra, which government forces recaptured from ISIL last Sunday.
Al-Qaryatain had been held by the militant group since late August. Syrian President Bashar al-Assad has been trying to retake al-Qaryatain and other pockets of ISIL control to reduce the jihadist group's ability to project military power into the heavily populated western region of Syria, where Damascus and other main cities are located.
Syrian state television said the army and its allies "fully restored security and stability to al-Qaryatain after killing the last remaining groups of Daesh terrorists" in the town, using the Arabic acronym for ISIL.
In a statement read out on Syrian television, the military command said this was a strategic victory which secures oil and gas routes between the Damascus area and oilfields in eastern Syria. It also disrupts Islamic State supply routes within Syria.
Government forces entered the town from a number of directions, Syrian media said. A Syrian military source told SANA state news agency the army had cleared areas northwest of the town of explosives planted by Islamic State.
Islamic State militants retreating from Palmyra laid thousands of mines which the Syrian army is now clearing before civilians can return.
The Syrian Observatory for Human Rights said government forces had taken over half the town and that fierce fighting continued between Assad's troops and Islamic State to the north and southeast of al-Qaryatain.
The Britain-based Observatory, which monitors the five-year-old Syrian conflict through a network of sources on the ground, said more than 40 air strikes by Russian and Syrian planes hit areas near the town on Sunday.
ISIL still has complete control over the city of Raqqa, its de facto capital, and it controls most of Deir al-Zor province in eastern Syria, which borders Iraq.