A man unleashed a round of gunfire and hurled a grenade at the Istanbul offices of Turkish President Tayyip Erdogan, Turkish media reported Thursday citing police. The grenade did not go off.

Police said the man was arrested almost immediately at Dolmabahce Palace in Istanbul.

“We know his identity and the links he has, but we don't want to share it now,” Istanbul police chief Selami Altiok told Turkish daily Hurriyet. “He’s served time in prison before.”

The man also reportedly had an automatic weapon, two more grenades and a homemade bomb on his person.

Police and security officers, some of whom were clad in red ceremonial costumes in honor of Turkey's founder, Mustafa Kemal Atatürk, cordoned off the area. The suspect was taken to a police station. A bomb disposal team was sent out to the area, with Turkey’s NTV channel reporting that the device was destroyed in a controlled explosion.

Motives for the attack currently remain unclear. However, the country has been home to protests recently surrounding perceived lack of decisive action in dealing with Islamic State in the Syrian town of Kobani, near the border.

Pro-Kurdish protesters were met with tear gas and water cannons. The subsequent rioting and violence resulted in over 40 fatalities by October. November 1 saw an international day of protest for the Kurds, with tens of thousands rallying across the world in support of the Kurdish fighters in Kobani, demanding stronger military action to combat the jihadists.

There have been also massive protests in 2013 over a corruption scandal implicating government officials, as well as the Gezi Park movement. The activists opposed then-PM Erdogan's plans to redevelop Taksim Square, including razing Gezi Park – one of the last green spaces in central Istanbul – to build a shopping center.