Troops backed by pro-government militia took two towns from the Islamist group, which claims ties to al Qaeda, in fighting Monday, said President Sheikh Sharif Sheikh Ahmed, clad in the military uniform he has worn since the government launched its offensive.
Battles have raged across central and southern Somalia in recent weeks as Somali troops backed by the moderate Ahlu Sunna Waljamaca militia struggle to reclaim territory from al Shabaab.
"Al Shabaab is on the verge of collapse," the president told reporters.
"We shall also sweep them from Mogadishu. Our enemies have suffered a great loss, it is obvious they will run away from many towns."
Residents said al Shabaab had deserted more towns after it was rumored the Ethiopian and Somali troops had advanced further. Ahmed said Saturday his fighters were receiving logistical help from Ethiopian troops.
Kenyan police said suspected al Shabaab rebels had entered Kenya and warned the public to be on alert and provide any information to aid in arresting them.
The rebels who crossed the border were fleeing the fighting in Somalia, Kenyan authorities said. They are concerned because the Islamists have threatened to strike at Kenya to punish the east African country for training hundreds of new recruits to bolster Somali troop numbers.
Kenya has been twice hit by al Qaeda.
The militants have waged an insurgency against the largely ineffective U.N.-backed government and control large chunks of southern and central Somalia. Counter-terrorism experts say the lawless nation is a haven for foreign jihadists.
In the past few weeks, Somali forces have clawed back parts of Mogadishu and now control 70 percent of the city, the government says.
Government soldiers captured Luq, 80 km (50 miles) from the Ethiopian border, and Elwaq, a frontier town close to Kenya after taking Beledhawo over the weekend.
"We have taken Luq town after a brief fight. Al Shabaab has fled," Abdi Fatah Mohamed Gesey, former governor for Bay region, told Reuters by telephone from the agricultural town.
"We will not stop our operations against al Shabaab. The residents have warmly welcomed us and our next stop will be Baidoa."
Sustained clashes over the past week have focused on the capital and Somalia's southern border with Kenya. Government troops and African Union peacekeepers say they have inflicted heavy losses on al Shabaab militants in Mogadishu, but have also sustained some casualties.
"Our troops have captured Elwaq, nine km from the Kenyan border, peacefully," Colonel Mahamud Ali Shire told Reuters by telephone.
"They run away from the town. We are now headed for Garbaharey, we have heard their last convoy has left for Bardhere to keep their foreign fighters safe, but we will not for a minute stop our fight against them."