Gunmen blasted their way into a hotel and office complex in the Kenyan capital sending workers fleeing for their lives in an attack claimed by Somali Islamists al Shabaab.
At least seven people were killed and eight wounded, hospital officials and witnesses told Reuters.
Kenyan police chief Joseph Boinnet said the attack began with an explosion targeting cars followed by a detonation from a suicide bomber.
"Some armed criminals still holed up in the building and our special forces are, as I said, engaged in that position to flush them out.
"We ... also regret that there could have been some injuries and we are in the process of confirming the nature and the types of injuries."
As he spoke, there was heavy gunfire followed by an explosion, a reporter on the scene said.
Hospital officials confirmed at least eight were wounded.
The "terror attack" on the upscale 14 Riverside Drive complex started after 3pm local time.
CCTV footage showed three attackers dressed in black running across the parking lot, shortly followed by a fourth.
At least two of the men were wearing green scarves and one appeared to be wearing a green belt with grenades in it.
About seven hours later, Interior Minister Fred Matiang'i announced all buildings had been secured and scores of people evacuated from the scene.
He did not comment on the whereabouts of the attackers and said security forces were still "mopping up" in the area.
Serge Medic, the Swiss owner of a security company who ran to the scene to help civilians when he heard of the attack from his taxi driver, said he entered the building with a policeman and two soldiers but they came under fire and retreated.
"The main door of the hotel was blown open and there was a human arm in the street severed from the shoulder," he said, adding that there was an unexploded grenade lay in the lobby.
Medic, who was armed, entered the building with a policeman and two soldiers, he said, but they came under fire and retreated.
"One man said he saw two armed men with scarves on their head and bandoliers of bullets," Medic said.
A woman shot in the leg was carried out and three men emerged covered in blood. Some office workers climbed out of windows. Many told Reuters that they had had to leave colleagues behind, still huddled under their desks.
"There's a grenade in the bathroom," one officer yelled as police rushed out from one building.
The attack began about 3pm local time. Four armed men entered the complex, eyewitnesses say.
A woman working in a neighbouring building told Reuters: "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."
Explosions were heard and a plume of smoke rose above the compound, with vehicles on fire in the car park.
One police officer at the scene said: "People are dying."
According to its website, 14 Riverside is home to the local offices of international companies including BASF, Colgate Palmolive, Reckitt Benckiser, Pernod Ricard, Dow Chemical and SAP, as well as the dusitD2 hotel, part of the Thai hotel group Dusit Thani.
German business software group SAP said all staff working at its office in Nairobi had been brought to safety.
"We have confirmation that all our staff have been accounted for," a company spokesperson said.
"The SWAT team on the ground were very efficient and extracted all the employees that were in the building at the time to safety," she said.
The five-star hotel has 101 rooms and has its own spa and several restaurants.
The Australia embassy is across the road from the compound. Kenya is an expatriate hub for diplomats, aid workers, businessmen and others operating around east Africa.
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.
Kenyan troops originally went into Somalia to try to create a buffer zone along the border. They are now part of an African Union peacekeeping force that supports the Somali government in its battle against al-Shabaab.
Somalia's al-Shabaab are a militant Islamist group that opposes the Somali government but has also carried out attacks throughout East Africa.
In September 2013, al-Shabaab gunmen entered the Westgate shopping mall in Nairobi and targeted shoppers.
During an 80-hour siege at the upscale centre, 67 people were killed.
Two years later, the group carried out its deadliest ever assault in Kenya, shooting dead almost 150 people at Garissa University.
- Reuters / BBC