A land mine explosion has killed at least 19 passengers of a minibus in Somalia hours after the troubled nation's president declared a new war against the al-Shabab armed group.

The minibus was travelling in the southern Lower Shebelle region on Thursday when it ran over the explosive device near the village of Golweyn, about 120km from the capital Mogadishu in an area contested between al-Shabab and government and African Union troops.

"The number of people who died in the blast reached 19 - including women and children - and several others were wounded," Ibrahim Adam Najah, governor of Lower Shebelle, told local media.

Police official Ibrahim Isack told AFP news agency "the minibus was transporting 21 people when it ran over the land mine and most of them died in the blast".

"The mine was planted by the violent terrorists," said Isack, referring to al-Shabab, which is linked to al-Qaeda.

There was no immediate claim of responsibility.

Mohamed Abdulahi, a witness from a nearby village, said he saw the bodies of at least 10 people, including three children and seven women.

"Their bodies were shattered by the blast," he said.

Abdulahi Moalim Abdi, an elder from Golweyn, called the attack "horrible".

"Everybody is shocked, innocent civilians blown up while travelling to their houses," said Abdi.

READ MORE: Somalia leader declares country a 'war zone'

The blast came shortly after Somalia's President Mohamed Abdullahi Mohamed declared a new war against al-Shabab, which has been active in the nation for more than a decade.

"I am announcing a state of war in the country and call on the public to stand with the national army to help fight terrorists," the president said at a press conference.

Mohamed, who took office in February, on Thursday replaced the heads of the army, police and national intelligence.

"We are very sorry for those kids who have been misled, and we are offering al-Shabab fighters an ultimatum of 60 days to surrender otherwise they will face the consequences," he said.

"I also extend amnesty to the youth who have been misled with the wrong extremist ideas."

The group emerged out of a fight against Ethiopia, whose troops entered Somalia in a US-backed invasion in 2006 to topple the Islamic Courts Union that was then controlling Mogadishu.

While it has lost territory and was forced out of Mogadishu by African Union troops in 2011, al-Shabab continues to strike in the capital and countryside.