A blast that wounded dozens in central Nairobi has been described as a terrorist attack by the country's prime minister, in contradiction of earlier reports that it was caused by an electrical fault.

"This is terrorism. This is a heinous act. We are under threat but we will not be cowed," Raila Odinga said at the site of the blast in Nairobi's commercial heart.

The blast ripped through a small shopping complex in Nairobi, wounding at least 28 people.

Though police could not immediately confirm what caused the blast, Oraw Ojode, assistant minister for internal security, had said that the explosion could have been the result of an electrical fault inside the building.

"Let me not speculate this is a terrorist attack. It could be a wire fault," Ojode said.

His claims were refuted by an injured bystander who told AP she saw a bearded man leave a bag at the stall, minutes before the explosion.

Speculation that the Al-Shabaab terrorist group was behind the attack also emerged.

A pro-Shaabab Twitter site, Al-Kataib, also reported "a huge explosion in Nairobi" seconds after the blast.

Al-Shabaab militants from neighbouring Somalia have long threatened to carry out substantial attacks in Kenya following the government's decision in October to send troops into Somalia to help fight the insurgents.

Kenyatta National Hospital's acting chief executive, Thomas Mutie, said 28 wounded had been received in the hospital including four with serious injuries. Mutie also said that none of the injured had shrapnel in them.