"There was some fighting, but not so heavy," said a spokesman for the African Union mission in Somalia, adding that most al-Shabab fighters had already left the port.
The advance comes a week after a new parliament was sworn in.
Merca is the third largest port in southern Somalia and the African Union says its seizure will help in the operation to take Kismayo - the biggest town still in al-Shabab's hands.
The new batch of MPs is expected to elect a president in the coming weeks, as part of a UN process intended to end two decades of anarchy in Somalia.
However, a row is developing over moves to prevent a group of 16 people accused of war crimes from becoming MPs.
Current President Sheikh Sharif Sheikh Ahmed wants the 16 to be allowed to take their seats and says he will refer the matter to the Supreme Court.
But the 16 were rejected by a UN-sponsored vetting committee and the United Nations, together with a number of Somali leaders, say the court has no standing in the matter.
Analysts say the rejected MPs still have powerful militias and could disrupt any government formed after Tuesday, when parliament is due to meet to choose a new speaker.
Although pro-government forces have gained much territory recently, al-Shabab, which has joined al-Qaeda, still controls many southern and central areas of the country.