Mozambique's military says it has regained full control of the coastal town of Palma, more than a week after it was raided by militant Islamists.
A "significant" number of militants were killed in the counter-offensive, an army spokesman said.
State radio reported that residents who had fled were starting to return - some to homes that were looted.
Dozens of civilians were killed and at least 11,000 displaced after the militants invaded Palma on 24 March.
A South African and British national were among those killed in what was one of the biggest attacks by the militants in northern Mozambique's Cabo Delgado province since they launched an insurgency in the region in 2017.
Communication with the town, which has a population of about 75,000, remains cut.
The militants, known locally as al-Shabab, have pledged allegiance to the Islamic State (IS) group.
Their assault on Palma forced energy giant Total to suspend its multi-billion dollar natural gas project in Afungi, a short distance from the town.
Total withdrew its staff on Friday, while the United Nations suspended flights to evacuate civilians because of security concerns.
Army spokesman Brigadier Chongo Vidigal said the gas plant was secure, and Palma was now "safe" .
"The airfield area was the only one we needed to clear and we did that [on Sunday]. It's completely safe," Brig Vidigal was quoted by AFP news agency as saying.
In the first footage from Palma in the aftermath of the attack, state television broadcast images of soldiers putting black plastic sheets over the dead on the streets, reports the BBC's Jose Tembe from the capital Maputo.
Although some residents were reported to be returning, the streets were mostly deserted.
The town's hospital, commercial banks and the state prosecutor's office were all destroyed, our reporter adds.
The governor of Cabo Delgado, Valgy Tauabo, visited Palma on Sunday, and promised to help people rebuild their lives.
"We are now moving on to the next stage, one as critical as retaking the town, whereby we will be welcoming the communities who fled to the bush," Brig Vidigal said.
Thousands of others fled by boat to Pemba, the capital of Cabo Delgado.
Fears insurgency could spread
Many people are questioning why it took around 10 days for the military to regain full control of Palma.
It suggests that the militants have become strong, and government forces are struggling to contain the insurgency.
A private security firm from South Africa, Dyck Advisory Group, has been helping the military to fight the militants, but the government has never officially acknowledged its involvement and there are reports that it has suspended its contract.
The regional body, the Southern African Development Community (SADC), is due to discuss the insurgency at a meeting later this week, amid fears that it could spread.
There have been calls for the deployment of regional troops, but Mozambique's government has so far resisted this. Many academics agree with its decision, saying the deployment of a regional force could complicate the situation and some of its troops may even collude with the militants.
Instead, it has called for its army to be given training and resources to fight the militants - an unspecified number of US military instructors are already in Mozambique for this purpose.
Portugal, the former colonial power, has also said it will send about 60 troops in the coming weeks to provide training.
BBC
More about: