Sabri Uzun, the former head of the National Security Directorate’s intelligence department in Ankara, was detained on Tuesday on accusations of insulting Turkish President Recep Tayyip Erdoğan and aiding a terrorist group, according to Turkish media reports.

Uzun served as head of the intelligence department between 2003 and 2006.

A statement released by the Ankara Chief Public Prosecutor’s Office said Uzun was detained on accusations of insulting the president, disseminating terrorist propaganda and aiding a terrorist organization.

The statement did not cite any specific terrorist organization related to Uzun’s detention or how he insulted the president.

However, Uzun’s detention is seen as linked to a tweet he posted on April 17 when opposition mayoral candidate Ekrem İmamoğlu was declared the winner following 17 days of ambiguity over the results of the March 31 election in İstanbul.

İmamoğlu was certified as mayor on April 17 because the ruling Justice and Development Party (AKP), whose candidate lost the election, disputed the results, asking for a recount of votes in many districts and even demanding that the İstanbul election be held again.

In his tweet Uzun congratulated İmamoğlu for his election and said: “May your time in office be beneficial. I hope you won’t say, ‘Zero the [money] my son.’ I hope you won’t wear a watch that cost TL 750,000. I hope you won’t have seven safes and money counters. May you walk on the right path. Never be diverted from decency. I congratulate your mother and wife [on your success].”

Uzun was referring to the content of voice recordings and evidence of corruption investigations that became public in late 2013 in which then-Prime Minister Erdoğan’s close circles and four ministers were implicated.

Back then, voice recordings of two people — alleged to be Erdoğan and his son, Bilal, — circulated on the Internet.

The voices were heard discussing how to get rid of large amounts of money from an undisclosed residence with the alleged voice of Erdoğan telling his son to “zero” the money. Erdoğan denied the corruption charges and labeled the investigations as a coup attempt against his government.

This article originally appeared in Turkish Minute on Apr 23.