Kenyan President Uhuru Kenyatta has said that a siege by suspected militants in Nairobi is over and all the attackers have been "eliminated".
Gunmen attacked the compound in the Westlands district of Kenya's capital on Tuesday, killing at least 14 people.
Officials originally announced the end of the siege hours after it began, but gunfire and explosions were heard again early on Wednesday.
The Somalia-based militant group al-Shabab said it was behind the attack.
It is not clear how many attackers there were.
Ghana News Headlines
For latest news in Ghana, visit Graphic Online news headlines page Ghana news page
The complex houses the DusitD2 hotel as well as offices.
In a TV address to the nation, Mr Kenyatta said 14 people had been killed but 700 others were safely evacuated from the complex.
However, the Kenyan Red Cross put the number of dead at 24.
A US citizen is among the dead, the US State Department said. He has been named as Jason Spindler.
A British citizen with dual South African nationality was also killed and another Briton was wounded, the UK Foreign Office said.
"I can now confirm that... the security operation at Dusit is over and all terrorists have been eliminated," the Kenyan president said.
"We will seek out every person that was involved in the funding, planning and execution of this heinous act," he added, vowing to pursue them "relentlessly".
"We are a country governed by laws, rules and regulations - a country that embraces peaceful coexistence... I must also state that we are also a nation that never forgets those who hurt our children."
How did the attack unfold?
The attack began at about 15:00 local time (12:00 GMT) when four 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.