Police said they had used sniffer dogs, but that no weapons or explosives had so far been found.
The raids, involving special forces police, targeted first an Islamic cultural centre in western Charlottenburg district, and then a building in the southern suburb of Britz.
"In connection with this threat, two men were detained in #Britz," tweeted Berlin police, adding in another message that "during a search of their vehicle, a suspicious object was found".
The men were aged 28 and 46, reported national news agency DPA.
Bild newspaper reported that police had acted on a tip-off that an attack was being planned, as European police forces are on high alert following the bloody jihadist attacks in Paris.