A car laden with explosives has blown up near an army checkpoint outside Mogadishu, wounding at least four soldiers, according to a Somali security officer.

Soldiers reportedly chased the driver before he detonated the explosives.

"We received information of the car bomb and we pursued it, but he blew up while we were chasing him," the security officer said.

It was not immediately clear who was responsible for the explosion.

In the past, al-Shabab has taken responsibility for blasts and gun attacks in the capital.

The armed group has said that it would launch deadly attacks against Mohamed Abdullahi Mohamed, Somalia's new president, also known as Farmajo.

#UPDATE: Four soldiers wounded after suicide bomber blew himself up near army checkpoint outside #Mogadishu - Witness #Somalia pic.twitter.com/md5wH58h6C — Live From Somalia (@Tuuryare_Africa) February 27, 2017

Al-Shabab earlier this week denounced Mohamed's election, calling him an apostate.

The new president, who was inaugurated on Wednesday , has promised to make security a priority.

On Sunday, a car bomb in the capital killed at least 39 people .

Fighters affiliated with the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) have also emerged in Somalia.