Fighters with the al-Shabab extremist group ambushed an African Union convoy in southern Somalia on Sunday, killing at least eight soldiers, a Somali military officer said.

The al-Qaida-linked al-Shabab fighters attacked the convoy near Bulo-Marer town in Lower Shabelle region, Col. Muhyadin Yasin said. The attack came hours after a car bomb in the capital killed at least five people, most of them civilians.

Uganda's defense ministry confirmed the attack on the multinational force, saying an unknown number of troops were killed. "A lot of damage was inflicted on the enemy," a statement said.

Al-Shabab claimed that the attack killed 39 soldiers.

Despite being forced out of many cities and towns across Somalia, the extremist group continues to launch lethal attacks in the capital, Mogadishu, and elsewhere. Al-Shabab wants to oust the central government and install a strict version of Shariah law.

The extremist group maintains a presence largely in rural areas and continues to pose immense challenges to the allied Somali and African Union forces travelling between remote towns. Al-Shabab also attacks their military bases as well as neighboring countries that have sent troops to support Somalia's fragile central government.

Hundreds of African Union soldiers have been killed in recent years.

Earlier Sunday, a car bomb blast near a police station in Mogadishu killed at least five people and wounded at least 13 others, police said. The explosion shattered a month of relative calm in the capital, often a target of the extremist group al-Shabab.

The blast near Waberi police station along the busy Maka Almukarramah road may have been a suicide bomber, Capt. Mohamed Hussein said. Most of the victims were civilians.

Al-Shabab often carries out deadly bombings in Mogadishu against high-profile targets such as hotels and checkpoints.

Sunday's blast occurred amid a traffic jam while soldiers were searching cars at a nearby intersection.

Somalia's Prime Minister Hassan Ali Khaire said no such blast had occurred in the capital for a month.