The attack began at a bank inside the compound. An explosion ripped through three vehicles in the parking lot, followed by a suicide blast in the foyer of the Dusit Hotel, police chief Joseph Boinnet was cited as saying by CNN.
An unknown number of gunmen then burst through the complex, leading to a standoff that continued through the night, with people trapped in various parts of the buildings.
"I can now confirm that... the security operation at Dusit is over and all terrorists have been eliminated," Kenyatta said in a televised address to the nation and added that 14 people had been killed.
"No further threat to public exists," the Interior Ministry said in a statement. "Civilians who had been secured in one building by security while mopping up continues now safely evacuated. All buildings and surrounding area secure."
But sporadic gunfire and explosions continued hours after the all clear. Officials said that the evacuation was still ongoing in the morning.
A US citizen was among the dead, the US State Department said. A British citizen was also feared dead.
In 2013, Al-Shabaab militants targeted the luxury shopping centre of Westgate, killing 67 people in a siege that lasted several days.