Guards at Iran's presidential office building in Tehran opened fire, wounding a man carrying a large blade and trying to enter the compound, Iranian media said on February 5.
The attacker was shot in the leg when trying to pass the security gate.
Hamid Reza Goudarzi, deputy security chief, was quoted by the IRNA official news agency as saying that the 35-year-old man was taken to hospital.
There was no information on his condition or possible motives for trying to enter the presidential complex.
It wasn't clear whether President Hassan Rohani was in the complex.
According to Iranian media, the man was wielding either a large knife or a sword, and was wearing a white shroud, symbolizing his readiness to sacrifice his life.
The building is located in a district of Tehran that is also home to other key government institutions.
Based on reporting by AP and Reuters