Japheth Koome, the police chief for Nairobi, the capital, confirmed the death toll.
Authorities had initially said the building had six stories but it emerged that the ground and first floor had sunk following heavy rains.
The building, next to a river, had been declared unfit for human habitation by Kenya's National Construction Authority but was not torn down.
Bribe-taking officers in the county government are responsible for allowing contractors bypass building codes, Nairobi governor Evan Kidero said. He vowed to fire those responsible. The building's owner obeyed police orders and turned himself in for questioning, Koome, Nairobi's police chief said.
"People who've died in Huruma have died an unnecessary death. That death is a product of corruption ... someone is paid $10,000 or$20,000 to approve the building that cost the lives of Kenyans," nominated legislator Johnson Sakaja said.
Kenyan military personnel led the rescue operation using heavy machinery to remove concrete slabs. About 300 residents of two adjacent buildings, also built close the river, were evacuated.