Students fled their campus after the explosion at the nearby hotel and office complex.//AFP PHOTO
The explosion at the DusitD2 compound, which includes a 101-room hotel, restaurant and several office buildings housing local and international companies, was heard from AFP's bureau some five kilometres (three miles) away.
The Shabaab, which carried out a notorious assault on a Nairobi shopping mall in 2013, claimed responsibility, according to the SITE Intelligence Group which monitors jihadist activities.
AFP reporters at the scene saw wounded people being evacuated but said the full casualty toll was unknown. Occasional shots were being heard nearly four hours after the blast.
Simon Crump, who works in the complex, said terrified workers barricaded themselves inside their offices after "several" explosions.
"We have no idea what is happening. Gunshots are coming from multiple directions," he told AFP.
He later said that police had begun evacuating people from the office buildings.
A reporter at the scene said gunmen and security forces exchanged heavy gunfire.
"We are aware that there are armed criminals still holed up and our officers are trying to flush them out," said Inspector General of police Joseph Boinnet.
- 'A flash and a bang' -
John Maingi said there had been "a flash of lights and a loud bang" at the Secret Garden restaurant where he works.
"When I peeped outside I saw a human leg which has been cut off. We hid in the room and then some police officers rescued us," he said.
Police sirens echoed through the city and a helicopter buzzed overhead.
A private security guard at the scene told AFP he had seen four "gangsters" entering the compound.
"There was a bomb, there is a lot of gunfire," whispered another man working at the compound, asking not to be named.
"All police teams have been dispatched to the scene where the incident is. As at now we are treating it as anything, including the highest attack," police spokesman Charles Owino said by phone.
"All police teams including anti-terror officers are at the scene," he said.
An AFP reporter saw a bomb disposal squad blow up a car which they said had been used by the attackers to arrive at the complex.
Flames and plumes of black smoke billowed into the sky from the parking lot where several cars where ablaze. Scores of people fled the scene, some of them injured.
Meanwhile, the vast upscale Village Market shopping centre in northern Nairobi said on Twitter that it had closed temporarily as a "security precaution."
- Shabaab -
The scenes at DusitD2 were reminiscent of an attack in 2013 when gunmen stormed the city's Westgate shopping mall, killing at least 67 people.
Journalists carry a victim at the scene of the attack.// AFP PHOTO
That assault was also claimed by Somalia's Shabaab, which have been fighting to overthrow the internationally-backed government in Mogadishu since 2007.
Kenya suffered a spate of attacks after it sent its army into Somalia in October 2011 to fight the jihadist group.
On April 2, 2015, another Shabaab attack killed 148 people at the university in Garissa, eastern Kenya.