The incursion came in response to a film deemed by some to be offensive to Islam.
Several protesters climbed up onto the walls of the embassy and ripped down the US flag, raising another flag in its place.
Security reinforcements were rushed to the area and removed the trespassers.
“We had some people breach the wall, take the flag down and replace it,” State Department spokeswoman Victoria Nuland said. “What I heard was that it was replaced with a plain black flag. But I maybe not be correct in that,” she said, amid speculation that the flag that had been raised carried the emblem of a jihadist organization.
Reports also suggested the flag was inscribed with the Muslim profession of faith: “There is no God but God and Mohammed is the prophet of God.”
Several hundred demonstrators had already gathered outside the embassy to protest at a film produced by Egyptian Coptic Christians living in the US, which the protesters claim defames Islam’s Prophet Muhammad.
It was reported that the protesters tried unsuccessfully to set the flag alight before pulling it down.
Taken by surprise
Members of the crowd were reported to include members of Islamist groups and “ultra” football fans.