NAIROBI - A deadly siege by suspected militants in Nairobi has ended after all the attackers were “eliminated”, Kenyan President Uhuru Kenyatta has said.

Gunmen attacked a compound in the Westlands district of Kenya’s capital on Tuesday, killing at least 14 people. The Somalia-based militant group al-Shabab said it was behind the attack.

Two people believed to be linked to Tuesday’s siege on the complex, which houses the luxury DusitD2 hotel, have been arrested, officials said.

It is not clear how many attackers there were, but Kenyan police chief Joseph Boinnet told AFP news agency that “five terrorists” had been involved.

Confirming an end to the security operation at Dusit during a televised address, Mr Kenyatta said that 14 people had been killed and many more were injured, but that 700 others were safely evacuated. He added that “every person that was involved in the funding, planning and execution of this heinous act” would be “relentlessly” pursued. Separately, the Kenyan Red Cross said that 50 people remain unaccounted for.

A US citizen is among the dead, the US state department said. He has been named as Jason Spindler. In an interview with US broadcaster NBC, Sarah Spindler said her son was trying to “make a positive change in the third world in emerging markets”.

British citizen Luke Potter, who held dual South African nationality, was also killed, and another Briton was wounded, the UK Foreign Office said. Kenyan James Oduor, commonly known as Cobra, was tweeting as the attack was unfolding. He was known for his love of football and well liked.

Two Kenyan friends, Abdalla Dahir and Feisal Ahmed, were having lunch together in the grounds of the hotel when the suicide bomber struck, Reuters news agency reported. Friends described the pair as inseparable. On Wednesday, people made their way to a mortuary in Nairobi to help identify the bodies of their relatives and friends.

After 19 hours of terror, gunfire, bloodshed and inevitable confusion, the siege at an upmarket hotel and business complex in the hills west of Nairobi’s central business district ended abruptly on Wednesday morning. Throughout the night, cowering groups of civilians - many had spent hours hiding in their offices or in bathrooms - were escorted to safety by security forces amid sporadic bursts of gunfire and the boom of explosions that continued well beyond dawn.

On the crowded street outside the large, upmarket complex, friends and relatives embraced those who emerged and thanked Kenyan security forces.

The attack began at about 15:00 local time (12:00 GMT) when the gunmen threw bombs at vehicles in the car park before entering the lobby, where one blew himself up, police say. A woman working in a neighbouring building told Reuters news agency: “I just started hearing gunshots, and then started seeing people running away raising their hands up and some were entering the bank to hide for their lives.”

Security camera footage showed at least four heavily armed men walking in and opening fire. There are reports they had been seen visiting the compound in recent days.

At 23:00, Interior Cabinet Secretary Fred Matiang’i said all the buildings in the complex had been secured by security forces. “The situation is under control and the country is safe,” he told reporters. “Terrorism will never defeat us.”

But just an hour later gunfire and sporadic explosions were reported in the area. There was more heavy gunfire at about 07:00. Security forces combed their way through the building where frightened workers had barricaded themselves inside. In the early hours of Wednesday, more than 100 people were rescued. About 30 people are being treated at Nairobi hospitals, media reports say.

The five-star DusitD2 hotel has 101 rooms. Located in the Westlands suburb, minutes from the capital’s business district, it has its own spa and several restaurants. Kenya has seen a number of terror attacks in recent years - most notably in areas close to the Somali border and in the country’s capital.