Government troops, backed by forces from the African Union, also gained ground from the group in the country's capital, Mogadishu.
Reports suggest about 50 peacekeepers were killed in the offensive but the UN has not confirmed how many died.
Freedom of manoeuvre
Maj-Gen Nathan Mugisha, of the UN peacekeeping mission known as Amisom, said his forces had captured the former ministry of defence building in the north of the capital, gaining control of a major al-Shabab base.
"By taking these positions we have effectively reduced their freedom of manoeuvre in that sector," Gen Mugisha told Reuters news agency.
He said the offensive meant the UN forces now had control of seven districts in the capital, leaving six contested and three under rebel control.
The offensive in the town of Bulo Hawo began early in the morning. Dozens of militants were reported to have been killed in the fighting which lasted more than three hours.
"We have chased them to an area 40km (25 miles) south of the city," Sharif Abdiwahid Sharif Aden, a spokesman for the pro-government militiamen told Associated Press.
Eyewitnesses said Ethiopian troops were also part of the offensive against al-Shabab.
Somalia has not had a functioning national government for 20 years.
Al-Shabab controls much of southern Somalia and has been fighting interim government forces and the 8,000 AU troops for control of Mogadishu in recent months.
Follow us on twitter: http://twitter.com/Newgenafrica
Visit our partner site: http://www.ckrbs.co.uk/
WE ARE PROUD TO BE UNIQUELY AFRICAN! UNIQUELY YOU!!