Seven al-Shabab militants who attacked a high-security prison in Somalia's capital have all been killed, the country's government has stated.

A huge explosion and gunfire were heard coming from Godka Jilicow - a detention centre that holds al-Shabab militants - in Mogadishu on Saturday evening.

In a statement, al-Shabab claimed it released all the Muslim prisoners from the facility and inflicted heavy casualties on those guarding the centre.

The militants disguised themselves as soldiers in order to enter the prison, according to government-run news agency Sonna Live.

The government did not specify how many of its security forces were killed during the incident, but expressed condolences to the families of the fallen heroes.

Similarly, al-Shabab did not provide a death toll for its militants.

The fighting began at around 16:40 local time (13:40 GMT).

Godka Jilicow is situated near the Somali presidential palace, in the heart of Mogadishu. It is manned by Somalia's National Intelligence and Security Agency (Nisa) and holds al-Shabab militants and other high-profile detainees.

This attack is a significant blow to Nisa and raises questions about how the militants managed to access one of the most heavily guarded areas in the capital.

Al-Shabab, affiliated with al-Qaeda, has waged a brutal insurgency against the Somali government for nearly 20 years.

Notably, just hours before the attack, the government had reopened major roads in Mogadishu that were previously closed for security reasons, citing improvements in the city's safety.