Gunmen stormed the building on Tuesday, throwing bombs at vehicles before entering the hotel’s lobby, where one attacker blew himself up and others opened fire.

All five al-Shabaab militants who carried out the attack and overnight siege were also killed, with two people suspected of facilitating the attack arrested.

The number of those killed at the DusitD2 complex rose with the discovery of six more bodies at the scene and the death of a wounded police officer, said Joseph Boinnet, inspector-general of the Kenyan police.

Twenty-eight people were injured and taken to hospital, he said.

The dead include a British citizen named as Luke Potter, as well as 16 Kenyans, three people of African countries yet to be identified, and one American.

Mr Potter worked for international development charity Gatsby. The organisation said Mr Potter had “devoted the past 10 years of his career to helping some of the poorest and most vulnerable people in the world”, in his work across parts of East Africa.

Islamist extremist group al-Shabab, based in neighbouring Somalia, claimed responsibility for the atrocity on Wednesday.

It is the same group which carried out the 2013 attack at Nairobi’s nearby Westgate Mall that killed 67 people, and an assault on Kenya’s Garissa University in 2015 that claimed 147 lives, mostly students.

While US airstrikes and African Union forces in Somalia have degraded the group’s ability to operate, it is still capable of carrying out spectacular acts of violence in retaliation for the Kenyan military’s campaign against it.

Nairobi hotel attack – in pictures Show all 23 1 /23 Nairobi hotel attack – in pictures Nairobi hotel attack – in pictures Cars are seen on fire at the scene where explosions and gunshots were heard at the Dusit hotel compound, in Nairobi, Kenya Reuters Nairobi hotel attack – in pictures An injured man is evacuated from the scene of an explosion at a hotel complex in Nairobi's Westlands suburb AFP/Getty Nairobi hotel attack – in pictures A soldier takes cover next to a bullet ridden window EPA Nairobi hotel attack – in pictures People run for cover during gunfire and explosions in Nairobi EPA Nairobi hotel attack – in pictures Kenyan security forces take position following an explosion at a hotel complex in Nairobi's Westlands suburb AFP/Getty Nairobi hotel attack – in pictures Security forces on the scene of an explosion in Nairobi AP Nairobi hotel attack – in pictures Cars burn at the scene of an explosion in Nairobi AP Nairobi hotel attack – in pictures People are led away from the scene of an explosion at a hotel complex in Nairobi AFP/Getty Nairobi hotel attack – in pictures A soldier takes cover as gunfire continues at the scene of a suspected terror attack in Nairobi EPA Nairobi hotel attack – in pictures Armed plain clothes officials secure the damaged entrance of a hotel during ongoing gunfire and explosions in Nairobi EPA Nairobi hotel attack – in pictures Members of security forces take cover at the scene Reuters Nairobi hotel attack – in pictures People are evacuated from the scene of a suspected terror attack in Nairobi Reuters Nairobi hotel attack – in pictures Cars burn after an explosion in Nairobi AP Nairobi hotel attack – in pictures A member of security forces holds a weapon at the scene Reuters Nairobi hotel attack – in pictures Security forces advance at the scene of a suspected terror attack in Nairobi Reuters Nairobi hotel attack – in pictures Cars burn at the scene of an explosion in Nairobi Reuters Nairobi hotel attack – in pictures A glass damaged by bullets at the scene Reuters Nairobi hotel attack – in pictures Security personnel on the scene of a suspected terror attack in Nairobi Reuters Nairobi hotel attack – in pictures A woman is helped at the scene of an explosion in Nairobi Reuters Nairobi hotel attack – in pictures Security forces advance at the scene of a suspected terror attack in Nairobi Reuters Nairobi hotel attack – in pictures Security personnel on the scene of a suspected terror attack in Nairobi Reuters Nairobi hotel attack – in pictures Undercover police are on the scene of a blast in Nairobi AP Nairobi hotel attack – in pictures Security personnel on the scene of a suspected terror attack in Nairobi AP

The bloodshed in Kenya’s capital appeared designed to inflict maximum damage to the country’s image of stability and its tourism industry, an important source of revenue.

Twenty hours after the siege began, Kenyan president Uhuru Kenyatta announced the all-night operation by security forces to retake the complex was over and all of the extremists had been killed.

“We will seek out every person that was involved in the funding, planning and execution of this heinous act,” he said in a televised address.

A member of the British special forces was among those who took part in the military operation to end the siege.

The SAS soldier, who has previously served in Afghanistan and Iraq, was seen working to rescue civilians trapped amid the firefight and explosions, and guiding Kenyan forces as they tried to flush out the Islamist fighters from the buildings.

The soldier is part of a British training team based in Kenya, and was at the scene mentoring Kenyan troops.

Support free-thinking journalism and attend Independent events