The Syrian military says it has "fully liberated" the eastern border town of Albu Kamal, so-called Islamic State's last urban stronghold in the country.
Commanders said the victory signalled the "fall of the terrorist Daesh [IS] organisation's project in the region".
A monitoring group said militants had withdrawn to another part of Deir al-Zour province following negotiations.
IS now only controls a few villages and desert areas north of Albu Kamal, and scattered pockets elsewhere in Syria.
The jihadist group seized large swathes of Syria and neighbouring Iraq in 2014, when it proclaimed a "caliphate" and imposed its rule over some 10 million people.
But it has suffered a series of defeats over the past two years, losing Iraq's second city of Mosul this July and its de facto capital of Raqqa in northern Syria last month.
The official Sana news agency quoted a statement by the General Command of Armed Forces hailing the swift recapture of Albu Kamal as a "strategic achievement and a base for eradicating remnants of the terrorist organisation with its various names along the Syrian territories".
It said troops, after entering the town late on Wednesday, had engaged in fierce battles in which a large number of militants were killed.
Army engineers were already dismantling bombs and mines left by IS, while other units were pursuing jihadists who had fled in different directions into the desert and eliminating their remaining "dens", it added.
The Syrian Observatory for Human Rights, a UK-based monitoring group, cited its sources as saying that Albu Kamal was retaken by troops and Iranian-backed militiamen - led by members of Lebanon's Hezbollah movement - after the last militants withdrew to areas in eastern Deir al-Zour.
The sources added that militias had left open a corridor to allow the jihadists to flee northwards, where they are likely to encounter the Syrian Democratic Forces.
The US-backed alliance of Kurdish and Arab fighters, which captured Raqqa, is advancing east of the Euphrates and has seized several oil and gas fields.
The US-led multinational coalition against IS recently estimated that there were 1,500 militants left in the Euphrates Valley area, among them leading figures.
The fate of the civilians living in Albu Kamal was unclear. United Nations officials in Damascus said that in the last few weeks an estimated 120,000 residents had been displaced, AFP news agency reported.
On Wednesday, Syrian troops linked up with Iraqi forces on the border, giving the Syrian government control of its first official crossing with Iraq since 2012.
Last week, Iraqi forces secured the Iraqi side of the crossing after taking the nearby city of al-Qaim as part of an operation to clear IS out of its last pocket in Iraq.