At least 21 people were killed when Somali militants stormed a luxury hotel compound in Nairobi, Kenya's government has confirmed.
Hundreds were forced to flee the bloodshed at the DusitD2 hotel and business complex on Tuesday.
Some 28 injured people have been admitted to hospital, and Kenya's Red Cross said 19 are still missing.
Somalia-based Islamist group al-Shabab said it was behind the attack, which triggered a 19-hour security operation.
President Uhuru Kenyatta said the siege ended with five jihadist attackers "eliminated".
Kenya has been a target for al-Shabab since October 2011, when it sent its army into Somalia to fight the jihadist group.
The BBC's Andrew Harding, in Nairobi, says cowering groups of civilians were escorted to safety by security forces throughout Tuesday night, amid sporadic bursts of gunfire and the boom of explosions that continued well beyond dawn. Many had spent hours hiding in their offices, or in bathrooms.
On the crowded street outside the large, upmarket complex, friends and relatives embraced those who emerged and thanked Kenyan security forces.
Mourners have now begun to bury the dead.
In a televised address, President Kenyatta said "every person that was involved in the funding, planning and execution of this heinous act" would be "relentlessly" pursued.
Two people believed to be linked to the attack were arrested after raids on Wednesday, AFP reported.
According to Reuters news agency, al-Shabab issued a statement calling the attack "a response" to US President Donald Trump's decision to recognise Jerusalem as the capital of Israel.
Jerusalem is a sacred city in Islam, Judaism and Christianity - and while Israel regards the whole of Jerusalem as its indivisible capital, Palestinians claim the eastern part of the city as the capital of a future state.
Who are the victims?
Kenyan James Oduor, commonly known as Cobra, was tweeting as the attack was unfolding. He was known for his love of football and was well-liked.
Sadly we lost James Odu Cobra in the #RiversideAttack. He was a lovely chap. Always happy &funny. I enjoyed playing football against him a couple of times. I enjoyed the banter& the way he liked teasing https://t.co/9uUC73psIH Odu! pic.twitter.com/lcaV4N00wf— KIPCHUMBA MURKOMEN, E.G.H (@kipmurkomen) January 16, 2019
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 reports. Friends described the pair as inseparable.
US citizen Jason Spindler is among the dead. His brother, Jonathan, announced on Twitter that Jason had survived the 9/11 attacks in New York in 2001.
In an interview with US broadcaster NBC, Sarah Spindler said her son had been trying to "make a positive change in the third world in emerging markets".
Jason Spindler was one of those rare men who was loved by pretty much anyone be touched in Kenya and around the world. Today he was killed in the terrible al shabab attack in Nairobi. He chose a life of hope and inclusion. I am grateful to have known and learned from him. pic.twitter.com/B4YnxB6bic— Chris Schroeder (@cmschroed) January 16, 2019
British citizen Luke Potter, who held dual South African nationality, was also killed, and another Briton was wounded, the UK Foreign Office said.
How did the attack unfold?
The attack began at about 15:00 local time (12:00 GMT) on Tuesday. 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: "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, a government official said that all the buildings in the complex had been secured by security forces.
But just an hour later, gunfire and sporadic explosions were reported in the area. There was more heavy gunfire at about 07:00 on Wednesday.
Security forces then combed their way through the building where frightened workers had barricaded themselves inside.
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.
What happened inside the complex?
When the gunmen first entered there was confusion, as people first tried to escape and then retreated into the building as they came under fire.
One eyewitness, Faith Chepchirchir, told Reuters: "People were trying to run towards the gate, but then I saw everyone who was running towards the gate was coming back from the gate, now heading to this opposite direction.
"So for me we just closed the doors and then gunshots were just being sprayed all over. From the top, I think [the gunmen] went to the top floor and then started spraying bullets."
Many civilians remained holed up in the complex for several hours, as they hid from the attackers in bathrooms, and even under tables and chairs.
Some were able to keep in contact with loved ones by text.
They included Zinzi Khalwale, daughter of a former senator Boni Khalwale. Her father told The Daily Nation she had hidden in one of the rooms of her office until her rescue.
By the evening, all but the seventh floor of the complex had been cleared, but some civilians remained there, apparently in close proximity to the surviving attackers.
Who are al-Shabab?
They oppose the Somali government, but have carried out attacks throughout East Africa.
During an 80-hour siege at the upscale centre, 67 people were killed.
Two years later, the group carried out its deadliest ever assault in Kenya, shooting dead almost 150 people at Garissa University.