Kenya’s security forces have killed the Islamic extremist gunmen whose assault on a luxury hotel and shopping complex in Nairobi took 14 innocent lives, President Uhuru Kenyatta said.

Announcing the end of the operation to secure the DusitD2 complex in the capital, Mr Kenyatta said: “All the terrorists have been eliminated.”

In a televised address, Mr Kenyatta did not say how many attackers were involved.

He said more than 700 people were evacuated during the security operation and he urged Kenyans to “go back to work without fear”, saying the East African country is safe for citizens and visitors.

Hours before Mr Kenyatta spoke, sporadic gunfire could be heard from the scene after scores of people were rescued at daybreak during what police called a mopping-up exercise.

The attack involved at least four armed men who invaded the hotel and shops.

Kenya Attack
Civilians flee the scene at a hotel complex (AP)

Al-Shabab – the Somalia-based extremist group that is allied to al Qaida – claimed responsibility for the carnage at the DusitD2 complex, which includes bars, restaurants, offices and banks. It is situated in Nairobi’s well-to-do Westlands neighbourhood, popular with many foreign expatriates.

Al-Shabab carried out the 2013 attack at the nearby Westgate Mall in Nairobi that killed 67 people.

International development charity Gatsby Africa said the organisation was “shocked and saddened” following the death of its Africa programmes director, Briton Luke Potter.

London-based company Adam Smith International also said two employees were killed in the attack.

Abdalla Dahir and Feisal Ahmed were killed on the terrace of a restaurant in the complex where the company has Nairobi offices, the company said in a statement.

Some 50 staff and consultants were safely evacuated, it added.

The statement said both had been working on the Somalia Stability Fund managed by the company to “bring peace and prosperity to Somalia through more than 100 local community initiatives”.

San Francisco-based company I-DEV International said American Jason Spindler was killed in the incident.

Mr Spindler was the co-founder and managing director of I-DEV.

The company said nine others in its Nairobi office were safely evacuated.

Authorities sent special forces into the hotel to flush out the gunmen. Early on Wednesday, Kenya’s interior ministry said in a tweet that all buildings had been secured and there was no further threat.

Kenya Attack
Security forces help civilians flee (AP)

However, at dawn, another explosion and gunfire was heard.

Kenya’s Citizen TV aired security camera footage that showed at least four heavily armed men in dark-coloured, paramilitary-style gear.

Kenya’s national police chief, Joseph Boinnet, said the coordinated assault began with an explosion that targeted three vehicles outside a bank, and a suicide bombing in the hotel lobby that severely wounded a number of guests.

Kenyan hospitals appealed for blood donations even as the number of wounded remained unclear.

Kenya Attack
The attack took place in the upmarket Westlands area (AP)

Video footage from inside the hotel showed Kenyan security officers searching the building and workers emerging from hiding while gunfire could still be heard. Some climbed out a window by ladder.

One man got up from the floor where he appeared to be trying to hide under a piece of wooden panelling.

Like the attack at the Westgate Mall, this one appeared aimed at wealthy Kenyans and foreigners. It came a day after a magistrate ruled that three men must stand trial in connection with the Westgate Mall siege.

Al-Shabab has vowed retribution against Kenya for sending troops to Somalia to fight it since 2011. Tuesday’s violence came three years to the day after al-Shabab extremists attacked a Kenyan military base in Somalia, killing scores of people.

Kenya Attack
Hospitals have appealed for blood donations (AP)

The group has killed hundreds of people in Kenya. In the deadliest attack, al-Shabab claimed responsibility for an assault on Kenya’s Garissa University in 2015 that killed 147 people, mostly students.

The latest carnage demonstrated al-Shabab’s continued ability to carry out spectacular acts of bloodshed despite a dramatic increase in US air strikes against it under President Donald Trump.