It was not clear who the men were, but the explosion wounded five people on Monday, Istanbul police said.
Earlier reports said six people had been hurt and that the cause was a natural gas explosion.
“It has been determined that the explosion occurred as explosive material was being prepared,” the police statement said.
Television footage showed the force of the explosion had torn off part of the facade of the five-storey building on the outskirts of Turkey’s largest city.
Police formed a security cordon around the area just before noon (0900 GMT) in the residential area known as Zeytinburnu district.
Series of attacks
A woman is comforted by
Turkey has been on edge in recent weeks due to a series of blasts in various cities, some of them caused by bombs.
Kurdish separatists, left-wing extremists and Islamist radicals have all been behind attacks in Turkey in recent years. Kurdish rebels claimed responsibility for bomb attacks at two Aegean Sea resorts last month, including one that killed three Turks and two foreigners.
On Sunday, an explosion ripped apart the boot of a taxi at Istanbul airport, wounding three people. Police said the blast was caused by a gas explosion in the car, which was powered by liquefied petroleum gas.