A prominent Turkish journalist on trial for disclosing state secrets escaped injury after an assailant shot at him twice outside a court in Istanbul.

Can Dündar, editor-in-chief of the Turkish daily Cumhuriyet, was outside the Caglayan Justice Palace during a recess May 6 when a gunman approached and fired at least two shots at him, CNN reported. Dündar was unharmed, but a journalist covering the trial was wounded in the leg. The shooter was arrested by plainclothes police officers.

The gunman, identified as Murat Şahin by Turkish media, has been charged with attempted murder and illegal possession of a firearm, said news outlets including the Daily Sabah, an English-language daily in Turkey.  Three other suspects arrested in connection with the shooting were released May 10.

Muharrerm Erkek, an opposition party member in Turkey’s parliament, told CNNTurk that he, Dündar and Dündar’s wife, Dilek, were walking to get coffee when the gunman approached them yelling “you’re a traitor” before opening fire. As Can Dündar escaped, Erkek and Dündar’s wife grabbed the gunman to stop him.

Dündar and his colleague, Cumhuiryet’s Ankara bureau chief Erdem Gül, were at court for their trial on state secrets charges related to a May 2015 video report that implicated Turkey’s intelligence service in arms shipments to Syria. Shortly after the shooting, the two received their jail sentences. Dündar was sentenced to five years and 10 months and Gül to five years, according to the BBC.

The pair were arrested in November shortly after the country’s national elections. President Recep Tayyip Erdogan said Dündar would ‘pay a heavy price’ for posting the video and has denied that Turkey is arming Islamist rebels fighting in Turkey.Erdogan personally filed a criminal complaint against Dündar and the newspaper in June.

After the verdict was announced, Dündar told reporters he had been the victim of two assassination attempts in the space of two hours: one with a gun and the other through the judicial system, according to The Guardian.

Western governments including the United States and France expressed concern after the sentencing. Rights groups including Human Rights Watch criticized the sentences.

“The decision to sentence Dündar and Gül to long prison terms for publishing the news shows how courts in Turkey comply with President Erdoğan’s campaign of revenge against critics,” said Emma Sinclair-Webb, senior Turkey researcher at Human Rights Watch, in a statement. “This has been a political trial from the start and part of the ongoing crackdown on journalism and on reporting on issues the public has a right to know about.”