NAIROBI —The attack by the Islamist militant group al-Shabaab on an upscale mall in Nairobi at the weekend fulfils a threat it made two years ago to retaliate over Kenya’s military intervention to back Somalia’s government.

At least 68 people died and 175 were injured when gunmen stormed the Westgate mall on Saturday in the Kenyan capital. About 30 hostages were still being held in the complex by late on Sunday, government officials said.

The group, whose full name means Mujahedeen Youth Movement in Arabic, claimed responsibility for the attack.

Al-Shabaab has been fighting Somalia’s government since at least 2006 to establish an Islamic state and impose sharia in the Horn of Africa nation. The group targeted Kenya after its army invaded Somalia in October 2011 to help African Union (AU) peacekeepers and Ethiopian forces battling al-Shabaab.

The militant group claimed responsibility in July 2010 for twin bomb attacks in neighbouring Uganda that killed 76 people watching the soccer World Cup final at two separate venues. Al-Shabaab said it targeted Uganda because the country had troops serving in Somalia’s A U peacekeeping force.

The deadly attack on the mall in Kenya on Saturday marked the third time in just two days that Islamist militants have struck an African capital.

Members of the Boko Haram Islamist group clashed on Friday with Nigerian security forces who were investigating a suspected militant weapons cache at a building site in Abuja. Nine people died in the fighting, the Nation newspaper reported on Saturday, citing an unidentified witness.

At least five people died in grenade and gun attacks blamed on al-Shabaab in the main Bakara market in Somalia’s capital, Mogadishu, on Saturday.

The US designated al-Shabaab as a terrorist organisation in 2008 and the United Nations (UN) Security Council has imposed sanctions on the group and at least 13 individuals linked to it.

The Kenyan government sent its troops into Somalia after accusing al-Shabaab of carrying out a wave of attacks on foreigners, including the murder of a British tourist and at least four kidnappings. The group denied responsibility and vowed to strike back.

The incursion by Kenyan troops helped to wrest strategic areas in Somalia from al-Shabaab’s control, including the port of Kismayo in October last year. Kismayo was key to the group’s ability to collect taxes to finance its activities and receive weapons and supplies.

Income from Somali ports earned the group as much as $50m a year, the UN Monitoring Group on Somalia said in 2011.