The death toll from a bomb and gun attack by Islamist militants on the hotel and office complex in Nairobi has risen to 21.

Kenya's police chief said: "We wish to inform that, as of this evening... six other bodies were found at the scene and one police officer succumbed very suddenly to his injuries."

Joseph Boinnet told reporters the deaths included 16 Kenyans, one Briton, one American and three people of "African descent who are yet to be identified".

Another 28 people who were injured in the attack had been admitted to hospital without giving details on their condition.

Kenyan security forces ended the attack earlier today after a 20-hour operation that rescued hundreds of people and left all five assailants dead.

More than 700 civilians were evacuated from the DusitD2 complex after a 20-hour, overnight siege that echoed a 2013 assault in which 67 people were killed in a shopping centre in the same neighbourhood.

Some hid under desks as bullets shattered plate glass doors. Others jumped from windows, or ran out under fire.

Fifty people believed to have been in the complex remain unaccounted for, the Kenya Red Cross said, raising the prospect of a higher death toll even after President Uhuru Kenyatta declared the militants defeated.

"The security operation at Dusit complex is over, and all the terrorists eliminated," Mr Kenyatta told the nation in a televised address.

"As of this moment, we can confirm that 14 innocent lives were lost through the hands of these murderous terrorists."

Mr Kenyatta did not specify how many assailants there were, but CCTV clips showed at least five dressed in black.

One is seen waiting outside the restaurant before blowing himself up in a cloud of debris just after 3pm local time yesterday. Four others then shoot assault rifles crossing the carpark.

The attack was claimed by Somali group al Shabaab, an al Qaeda affiliate fighting to topple the weak United Nations-backed government and impose strict Islamic law.

Air strikes against the group have stepped up under US President Donald Trump, but yesterday's attack showed it retains ability to strike outside Somalia's borders.

Neighbouring Kenya, a hub for expatriates, became a frequent target for al Shabaab after sending troops into Somalia to try to create a buffer zone along the long, porous border.

At least two groups of people were trapped throughout the night, with gunfire continuing as dawn broke.

Some sent text messages begging for medical help.

Eleven Kenyans - including two best friends who worked to help Somalia - an American 9/11 survivor, and a British development professional were among the casualties.

Some victims had been dining in the Secret Garden restaurant and lay slumped at tables, photos seen by Reuters showed.

The complex is home to offices of international companies including Colgate Palmolive, Reckitt Benckiser, Pernod Ricard, Dow Chemical ad SAP, as well as the DusitD2 hotel, part of Thai group Dusit Thani.

Hiram Macharia, marketing executive at LG Electronics, grabbed a fire extinguisher and headed downstairs after the first blast.

"Then we saw two of the attackers firing at the elevators and we turned back," he said outside the hotel.

"They were firing twice at each of the elevator doors and the two staircase doors on each floor as they walked up the building. One of them fired at our office doors, entered slightly and then moved on."

Mr Macharia and some colleagues hid under desks, but one person ran to the roof and was shot dead there, he added.

The attack at Dusit D2 is the first in Nairobi since gunmen stormed the city's Westgate shopping mall in 2013, killing at least 67 people.