A man opened fire and threw a grenade, which did not explode, Thursday at the Istanbul offices of Turkey’s President Recep Tayyip Erdogan, Turkish media reports said.

The man was immediately arrested at the site, which is part of the Dolmabahce complex in Istanbul, CNN-Turk news television reported. It was not immediately clear whether Erdogan was present at the time.

The man was detained and taken to a police station inside the Dolmabahce palace after the attack, Today’s Zaman reported.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

The report said the unidentified assailant was armed with an automatic rifle and a pistol and that he opened fire before throwing the hand grenade, which did not go off. The man was also had a homemade bomb on his person, Hurriyet Daily News reported.

Police then destroyed the device in a controlled explosion, NTV channel said.

There was no immediate word on the arrested man’s motives.

Erdogan, who served as prime minister between 2003 and 2014, was elected president last year. The strongman has come under growing accusations of authoritarianism.