The British embassy said the device detonated at about 9.50am on Tuesday on the 10th floor of the Sayeh Building in the downtown district of the Iranian capital.
No damage was caused by the exploding device that appeared similar to a concussion grenade, which produces only a loud noise and a shock wave on detonation.
It was not immediately known who was behind the blast.
The British embassy praised Iranian officials for the response to the incident, Mitra Behnan Mojtahedi, a public affairs officer at the embassy, said without elaborating.
Iranian officials were not immediately available for comment.
Offices of British Airways, British Petroleum, Lloyds and Mercedes Benz are on the 10th floor of the Sayeh Building, which is in Valiasr Avenue in Tehran.