It says Mocímboa da Praia was the rebels’ last stronghold. It is located in Cabo Delgado province, home to one of Africa’s biggest gas fields.
The insurgents have not yet commented.
Last month, Rwanda sent 1,000 soldiers to Mozambique to fight the militants, who launched an insurgency in 2017.
More than 3,000 people have been killed and 820,000 displaced during the conflict.
The Mozambican armed force have been struggling to regain control of the province.
Force spokesman Col Ronald Rwivanga later told the AFP news agency that the port “was the last stronghold of the insurgents, marking the end of the first phase of counter-insurgency operations”.
“We will continue with security operations to completely pacify those areas,” the spokesman added, voicing hopes that the displaced people would soon be able to return to their homes.
Significant military victories can be illusory
By Mary Harper, BBC World Service Africa editor
The Rwandan soldiers only arrived in Mozambique last month and already seem to be changing the course of the conflict. At least for now.
Highly trained, well-disciplined troops from a small African nation have, in some ways, achieved more in a few weeks than the Mozambican army has in four years.
The southern African regional bloc, Sadc, is sending in hundreds of troops, the former colonial power Portugal is on the ground instructing soldiers, and the European Union has established a training mission.
With this rush of foreign troops, Mozambique is beginning to look like other parts of Africa hit by Islamist insurgencies.
There are lessons to be learned. Poor co-ordination between multiple international and regional forces battling jihadists in Somalia and the Sahel has led to problems. What look like significant military victories can be illusory.
Chasing jihadists out of towns and other strategic areas does not mean they are defeated. They melt away into terrain they know better than anyone else, splinter into smaller units, change their tactics and hide amongst civilians.
But they live to fight another day.