Islamic State militants have re-occupied the ancient city of Palmyra, a Syrian government official and the group said.
The reported taking of the central city from government troops in a major advance follows a year of setbacks in Syria and neighbouring Iraq.
In retaking Palmyra, the extremist group appeared to be taking advantage of the Syrian and Russian preoccupation with Aleppo, timing its attack to coincide with a massive government offensive to capture the last remaining opposition-held neighbourhoods in the northern city.
Palmyra, with its towering 2,000-year-old ruins, holds mostly symbolic meaning in the wider Syrian civil war, although its location in central Syria gives it some strategic significance as well.
Islamic State militants re-entered the city on Saturday for the first time since they were expelled by Syrian and Russian forces amid much fanfare nine months ago.
The government's first important win against the Islamic State group in the internationally renowned ancient city gave Damascus the chance to try to position itself as part of the global anti-terrorism campaign.
The militants had spent 10 months in Palmyra, during which they blew up a number of temples and destroyed other artefacts.
Sunday's takeover came hours after government troops and Russian air raids pushed the group out of the city's parameters. IS militants then re-grouped and attacked the city from multiple fronts, forcing government troops to retreat.
Palmyra opposition activists said the militants were going door to door in the city, looking for remnants of government forces.
Homs Province Governor Talal Barazi told the pan-Arab Mayadeen news channel that the IS attack on Palmyra is a "desperate" reaction to the Syrian government military "victories" on the ground. He said the forces that support terrorism including western countries, Saudi Arabia and Qatar wanted to "realise some type of gain" and chose Palmyra because of its international reputation.
Scores of Syrian troops have reportedly been killed in fighting around Palmyra in the last few days.
While the battles are a distraction from the fight in Aleppo, they are unlikely to affect the government's final push on the last rebel-held Aleppo neighbourhoods. By Sunday evening, there was no sign that the army was shifting significant resources away from Aleppo for the fighting in central Syria.
The government and its allies have reportedly mobilised some 40,000 fighters for Aleppo.
"I don't think the regime would withdraw forces from Aleppo to Palmyra and risk losing Aleppo," said Rami Abdurrahman, the head of the opposition monitoring group the Syrian Observatory for Human Rights.
"I think the regime's priority now is to finish the battle for Aleppo before the end of the month for sure.
As for Palmyra, the whole international community would stand by it against IS."
Over the last year, IS has suffered a string of defeats in both Syria and Iraq, losing several towns and cities it had captured in 2014. It is now under attack in Mosul, the last major urban centre it controls in Iraq. A Kurdish-led Syrian force, backed by the US, is also pushing towards Raqqa, the group's de-facto capital in Syria, from the north.
Meanwhile, Turkey is backing Syrian opposition fighters who have reached the outskirts of al-Bab, the IS stronghold in northern Syria.
In going for Palmyra, IS picked a soft target to demonstrate that despite its battlefield losses, it retains the ability to carry out large attacks.
Mohammed Hassan al-Homsi, a native of the city who runs Palmyra News Network, said IS is steering away from north Syria where the anti-IS international coalition and Turkey have focused their fight. With its losses in Iraq and elsewhere in Syria, the militants are eyeing new terrain. They chose Palmyra for its desert terrain linked to Iraq's and its surrounding oil and gas fields, al-Homsi said.
State news agency SANA, quoting an unnamed military official, reported that the militant group received reinforcements from Raqqa, enabling it to attack with "large numbers" against military checkpoints around the city.
Russia's Defence Ministry laid some of the blame at the feet of the US-led coalition, saying it had scaled down its operation against Raqqa and allowed thousands of IS fighters to escape from Mosul. The ministry statement said more than 4,000 Islamic State fighters have been deployed for the Palmyra takeover, implying that the militants attacking Palmyra had recently left Mosul.
The Observatory and the Palmyra Coordination group said IS militants fought their way into the city in a multi-pronged assault, forcing government forces to retreat to the south.
A map distributed by the Observatory shows the areas controlled by IS to extend east, south and north of Palmyra, encompassing a number of strategic hills around the city and expanding the group's presence in rural Homs. Palmyra lies in Syria's largest province, Homs, which is mostly under government control.
Osama al-Khatib, of the activist-run Palmyra Coordination group which keeps in touch with residents in the city, said remaining government and allied troops were escaping from the south-western edge of the city where the ancient ruins are. He said the few remaining families in the city are also attempting to escape.
Al-Homsi's Palmyra News Network said intensive air strikes followed the IS takeover of the city. The group said IS fired on fleeing civilians while the group expanded its presence in rural areas around Palmyra.
In a video by the IS-linked Aamaq news agency, IS fighters were shown roaming a main square in the city that appears deserted at the foothills of the citadel that overlooks the ruins and the Palmyra Museum.
Russia had earlier claimed to have repelled an IS attack on Palmyra, saying it had launched 64 air strikes overnight that killed 300 militants. But hours later, the activists said IS had seized a castle just outside the town that overlooks its famed Roman-era ruins.
Palmyra was a major tourist attraction before the civil war broke out in 2011 and is home to world-famous Roman ruins.
The capture of Palmyra last year by Syrian troops and Russian air force was seen as a major triumph for the government, which had previously had little success in battling the extremist group.
After taking Palmyra, the two states turned their attention to wiping out the internal opposition in Damascus and Aleppo.
After tightening the siege on the eastern part of Aleppo city, the most prized urban stronghold for the opposition, government and allied troops have been steadily carving into the besieged enclave in a ground offensive that began in late November.
Syrian media reported that of the original 17 square miles rebel-held enclave, only 4 square miles remain in opposition hands.