Nairobi, Kenya (CNN) Men armed with guns and explosives burst into a hotel complex in Nairobi , killing at least 21 people in an attack that lasted hours and ended Wednesday morning.

"The security operation at Dusit complex is over, and all the terrorists eliminated," President Uhuru Kenyatta told reporters without giving details. He called the attackers terrorists.

More than 700 people were safely evacuated during the attack, he said.

Surveillance footage shows the moment one of the attackers self-detonated a suicide vest in the foyer of the hotel, leaving behind billowing smoke as people fled. Before the explosion, another man walked by, stared at the attacker and kept walking.

Shortly before Kenyatta declared the attack over, gunshots and explosions could still be heard at the scene.

More bodies recovered at the scene

Authorities recovered six more bodies from the scene late Wednesday, according to Inspector General of Police Joseph Boinett. That brought the death toll to 21.

Sixteen Kenyans, one Briton, one American and three unidentified people of African origin are among the dead, he said. Twenty-eight others have been hospitalized.

Jason Spindler, an American who survived the attacks on the World Trade Center on September 11, 2001, was among those killed in the attack. He was co-founder and managing director of I-DEV International, a firm advising on business strategy for emerging markets.

A British man is also among the dead, the UK high commissioner to Kenya said . Development organization Gatsby Africa identified him as Luke Potter , head of its forestry and tea portfolio.

The siege lasted hours

The coordinated attack started Tuesday afternoon as an unknown number of gunmen attacked the complex, leading to a standoff that continued through the night, with people trapped in various parts of the buildings hours later.

Security camera footage showed at least three armed men, dressed in dark clothing and with their faces uncovered, moving through the compound.

In a Twitter update, the Kenya Red Cross said at least 30 people were injured in the attack and 50 remained unaccounted for Wednesday.

One of the armed attackers is seen on security camera footage in the hotel compound on Tuesday.

Heavily armed attackers walk through the Nairobi hotel compound in this grab taken from security camera footage released to the local media.

Witness: 'I saw a human leg flying'

Alice Mwanza, 26, who works within the complex in a building adjacent to the hotel, was one of those trapped for several hours as the assault unfolded.

"Yesterday around 3 p.m., we heard an explosion and immediately we could see smoke through the office window," she said.

She asked her friends to join her so they can go and see what has happening.

"We thought it was fire from one of the buildings. However, as we took the stairs to the ground floor I saw a human leg flying and my workmates saw it, too, and now we could hear gun shots," she said.

The group took shelter inside a soundproof studio and were rescued more than three hours later by police and Red Cross workers.

"After we were discharged, I was given some pills to calm down and later at home I had this scary flashback of that human leg flying. I had to sleep with my lights on," Mwanza said.

Photos: Nairobi hotel attack A woman cries in a relative's arms on Wednesday, January 16, while identifying bodies of victims following a deadly attack on a hotel complex in Nairobi, Kenya. Gunmen attacked the DusitD2 Hotel the day before with gunfire and explosions. Hide Caption 1 of 30 Photos: Nairobi hotel attack A woman is rescued on the second day ot the attack at the hotel complex in Nairobi's Westlands neighborhood on January 16. Hide Caption 2 of 30 Photos: Nairobi hotel attack Members of the media surround Kenyan Interior Minister Fred Matiang'i as he gives a statement at the attack scene on January 16. The government has declared the siege is over. Hide Caption 3 of 30 Photos: Nairobi hotel attack People hug after their evacuation from the DusitD2 compound on Tuesday, January 15. Hide Caption 4 of 30 Photos: Nairobi hotel attack Security forces help people flee the scene of the attack in Nairobi on January 15. Hide Caption 5 of 30 Photos: Nairobi hotel attack Special forces protect people after an explosion at the Nairobi hotel complex on January 15. Hide Caption 6 of 30 Photos: Nairobi hotel attack People flee as security forces aim their weapons at the Nairobi hotel complex during the deadly attack January 15. Hide Caption 7 of 30 Photos: Nairobi hotel attack A woman hides behind a car after an explosion January 15. Hide Caption 8 of 30 Photos: Nairobi hotel attack An injured man is from helped from the scene January 15. Hide Caption 9 of 30 Photos: Nairobi hotel attack A woman reacts after being rescued January 15 from the hotel in the Kenyan capital. Hide Caption 10 of 30 Photos: Nairobi hotel attack Damages and blown out windows are seen in the hotel complex after the attack. Hide Caption 11 of 30 Photos: Nairobi hotel attack A woman is reunited with her family after her evacuation. Hide Caption 12 of 30 Photos: Nairobi hotel attack Kenyan security forces aim their weapons as they move through the hotel complex. Hide Caption 13 of 30 Photos: Nairobi hotel attack People take cover after hearing gunfire coming from the hotel. Hide Caption 14 of 30 Photos: Nairobi hotel attack Burned cars are seen at the site of an explosion at the DusitD2 Hotel. Hide Caption 15 of 30 Photos: Nairobi hotel attack Security forces arrive at the scene of the attack. Hide Caption 16 of 30 Photos: Nairobi hotel attack Civilians flee the scene during an attack on a hotel complex in Nairobi. Hide Caption 17 of 30 Photos: Nairobi hotel attack A fleeing civilian throws her handbag before climbing out of a hotel window. Hide Caption 18 of 30 Photos: Nairobi hotel attack A woman collapses after being rescued. Hide Caption 19 of 30 Photos: Nairobi hotel attack People run for cover after being rescued from the hotel. Hide Caption 20 of 30 Photos: Nairobi hotel attack Journalists carry a victim from the scene of an explosion. Hide Caption 21 of 30 Photos: Nairobi hotel attack Security forces surround a hallway in which an unexploded grenade lies. Hide Caption 22 of 30 Photos: Nairobi hotel attack An unexploded grenade lies in a hallway. Hide Caption 23 of 30 Photos: Nairobi hotel attack People put their hands up after being evacuated. Hide Caption 24 of 30 Photos: Nairobi hotel attack A member of the security forces is seen reflected in a window as he looks at bullet holes. Hide Caption 25 of 30 Photos: Nairobi hotel attack A woman is evacuated from the scene. Hide Caption 26 of 30 Photos: Nairobi hotel attack Security forces gather outside the hotel. Hide Caption 27 of 30 Photos: Nairobi hotel attack A woman is led away from the hotel attack. Hide Caption 28 of 30 Photos: Nairobi hotel attack A plainclothes police officer directs traffic on a highway near the scene of the attack. Hide Caption 29 of 30 Photos: Nairobi hotel attack Three women flee the hotel complex. Hide Caption 30 of 30

David Mureithi recounted how he and others were told by office security staff to flee through a back door after hearing an explosion followed by gunshots. "We could hear the gunshots getting closer and rapid," he said.

Two of his colleagues who had gone to get lunch shortly beforehand were killed, he said.

"I thank God I came out alive. I watched the news and it's still terrifying. "

Security services praised

Friends and relatives of those still unaccounted for anxiously waited for word on their loved ones as the interior ministry announced that authorities the site had been secured.

The President praised Kenya's security services for their swift response. "The operational priority of the security services was first and foremost to safeguard civilian life," he said.

Abbas Gullet, secretary general of the Kenya Red Cross, also hailed the rescue effort. "To have gotten out over 700 people out of that place, one would have to go in to understand and imagine what it took to get there," he said.

The Red Cross in Nairobi launched a blood drive to help the victims and urged people to donate. It also said it had launched a hot line to provide counseling and connect people who were searching for loved ones.

A woman is rescued Wednesday from the scene of the attack at a hotel complex.

Al-Shabaab claims responsibility

Somali Islamist militant group Al-Shabaab claimed responsibility for the attack and said it was a response to US President Donald Trump's 2017 decision to recognize Jerusalem as the capital of Israel, according to a statement circulated Wednesday.

"In a response to the witless remarks of US President, Donald Trump, and his declaration" of Jerusalem as the capital of Israel, the group targeted "Western and Zionist interests worldwide ... in support of our Muslim families in Palestine."

The attack happened three years to the day after Al-Shabaab militants targeted a Kenyan military base in neighboring Somalia, killing dozens of soldiers.

In 2013, Al-Shabaab militants targeted the luxury shopping center of Westgate, killing 67 people in a siege that lasted several days. Westgate is about 2 miles away from the site of Tuesday's attack.

Militants from the group also killed nearly 150 people, most of them students, in an attack on Garissa University College in Kenya in April 2015.

Civilians flee as security forces work to clear the buildings of a hotel complex in Nairobi during the deadly attack.

Attack started with car bombs

The latest attack began at a bank inside the compound Tuesday afternoon. An explosion ripped through three vehicles in the parking lot, followed by a suicide blast in the foyer of the Dusit Hotel, said Boinnet, the nation's police chief.

Crowds in bloodied clothes fled as armed officers escorted office workers to safety amid the gunfire. The flames in the parking lot raged, with the smoke visible from buildings far away in Nairobi's affluent Westlands neighborhood.

"As we were leaving, there were gunshots all over the place," said Evans Ng'ong'a, who was also inside the complex. "Attackers jumped over the fence and started shooting after the explosion."