The Garden City Mall, one of the biggest shopping centres in the city, has also been evacuated.
One of the men refused to be searched by security guards and was overpowered in a scuffle, a witness said.
In 2013, al-Shabab gunmen killed 67 shoppers at the city's Westgate mall.
Police spokesman George Kinoti told the BBC that the three men in custody were all Kenyans and the explosives were discovered in one of their bags.
"The situation is under [the] absolute control of our security agencies and the entire country is under multi-agency surveillance," he said.
The BBC's Alastair Leithead in Nairobi says it is believed to have been a small explosive device with a battery and a mobile phone attached, which could have been used as a trigger.
A statement from Garden City Mall quoted the governor of Nairobi Evans Kidero as saying it would reopen on Wednesday morning.
Mr Kidero also thanked the local police and mall employees for their "swift handling and containment of the situation."
Posted by Women Against Shariah on Friday, September 11, 2015