It comes days after IS was pushed out of the nearby ancient city of Palmyra.
IS captured al-Qaryatain in August, and abducted hundreds of residents, including dozens of Christians. Many were later freed.
A monitoring group said there were still pockets of fighting in the town.
The UK-based Syrian Observatory for Human Rights said on Sunday there were still IS fighters in the eastern parts of the town, but that they were withdrawing.
If the government reasserts its control over al-Qaryatain, it would be a further boost for President Bashar al-Assad, whose forces - backed by Russian air strikes - have made a string of gains against rebels in recent months.
The capture of the town would also provide a central base for government troops and their allies to attack IS-held areas near the Iraqi border, observers say.
A Syrian army general said troops had "restored security and stability to al-Qaryatain and farms surrounding it" and would cut off IS supply routes between the east and the Qalamoun mountains region in the west.
Al-Qaryatain, about 80km (50 miles) west of Palmyra, was taken over by IS fighters in their first major offensive since they seized Palmyra last May.
The mixed city had a large Christian population, many of whom fled, though dozens were abducted and reportedly taken to IS' de facto capital, Raqqa. They were released weeks later, reports said.
There has been a dramatic drop in fighting in Syria since a partial ceasefire came into effect last month, though IS and the al-Qaeda-linked Nusra Front were excluded and are still being targeted.
Syrian forces and their allies have retaken the central town of al-Qaryatain from so-called Islamic State (IS), dealing a further strategic blow to the militant group, state media say.