The blast occurred on Maka Almukarramah road in Mogadishu and the two victims were pedestrians. 

The exact target remains unknown.

Five other people were injured as security forces had been on high alert after tip-offs of a possible attack by the al-Qaeda-linked al-Shabaab.

Most of Mogadishu's major roads were blocked and cars were being searched by soldiers before the blast.

The US military earlier on Friday confirmed that al-Shabaab commander Ali Mohamed Hussein had been killed in an airstrike last weekend in southern Somalia.

Also known as Ali Jabal, he had been blamed for a number of deadly attacks in Mogadishu and was the highest-level al-Shabaab commander killed this year.

The Somalia-based al-Shabaab, the deadliest Islamic extremist group in Africa, often targets the capital with deadly bombings in high-profile areas such as hotels and military checkpoints.

On Friday, the US State Department issued an updated travel warning for Somalia, telling citizens to avoid going there because fighters associated with both al-Shabaab and the Islamic State group "operate with relative impunity throughout large parts of the country, including Mogadishu."

This is the second time in a week that a deadly blast has rocked Maka Almukarramah road.