Defeated Islamist militants fled from rapidly advancing Somali government forces on Monday as the troops captured the last remaining Islamist stronghold.

Thousands of Islamist troops, who abandoned the capital to take up arms 300 kilometres to the south, were driven away from the port city of Kismayo after trading fire with advancing Somali troops backed by Ethiopian tanks and fighter jets overnight.

The Islamist militants had withdrawn to Kismayo on Thursday after retreating from the capital Mogadishu.

The Islamist militiamen are said to be retreating south to neighbouring Kenya, which has promised to close its frontier to keep out any extremists.

"Kenya cannot be a haven for people who are not wanted by their lawful government,'' Kenyan government spokesman Alfred Matua said in a statement on Monday.

But the long and porous frontier is difficult to patrol, with nomads and Somalis living on the Kenyan side able to cross it easily.

Sea routes from southern Somalia were also being patrolled by the U.S. navy, hunting three suspected al Qaeda suspects wanted for the 1998 bombings of U.S. embassies in East Africa, The Associated Press reported.

Ethiopia accuses the Islamists of sheltering al Qaeda militants, which is a charge they reject.

The retreat of the Islamists marks a stunning turnaround for Somalia's government following a remarkable Ethiopian-backed offensive.

Just weeks ago, Somalia could barely control its base in the provincial town of Baidoa while the Council of Islamic Courts controlled the capital and much of southern Somalia.

But the intervention of Ethiopia, which has one of Africa's largest armies, forced the Islamists from the Somali capital Mogadishu and other strategic towns over the past ten days.

Still, the advance does not mark the defeat of the Islamists, who have vowed to strike back with an Iraq-style guerrilla war.

Diplomats from the region sought to arrange the quick deployment of African peacekeepers to help the interim government assert its authority and replace the muscle of Ethiopia, a Christian country long despised in Muslim Somalia.

The countries have a history of troubled relations over their disputed border.

The Islamists have depicted the conflict with Christian-led Ethiopia as a holy war against "crusaders," which taps into popular anti-Ethiopian sentiment stirred by decades of hostility between the two neighbouring nations.

In a bid to establish authority, Prime Minister Ali Mohamed Gedi ordered a countrywide disarmament that comes into effect Tuesday.

He also offered the Islamist rank and file amnesty if they surrendered.

But disarmament will be an enormous task in a country awash with weapons after more than a decade of civil war.

"The warlord era in Somalia is now over,'' Gedi said at a news conference in the recently captured capital of Mogadishu.

But Somali warlords, who have begun returning to Mogadishu after the Islamists were defeated, have not yet expressed their agreement.

With files from The Associated Press