By Ayla Jean Yackley and Melih Aslan
Two prominent Turkish journalists have been sentenced to at least five years in jail for revealing state secrets, just hours after a gunman tried to shoot one of them outside the Istanbul courthouse.
Can Dundar, editor-in-chief of the opposition Cumhuriyet newspaper, who was unscathed in Friday's shooting, was given five years and 10 months.
Erdem Gul, the newspaper's Ankara bureau chief, was sentenced to five years. They were acquitted of some other charges, including trying to topple the government.
The case, in which President Tayyip Erdogan was named as a complainant, has brought widespread condemnation from global rights groups and increased fears about freedom of the press in Turkey, a NATO member and EU candidate country.
Hours before the verdict was handed down, an assailant attempted to shoot Dundar.
In full public view, before a courthouse, the attack marked an alarming development in a country already grappling with bombings by Kurdish insurgents and spill over of violence from neighbouring Syria.
The man shouted "traitor" before firing at least two shots in quick succession. A reporter covering the trial appeared to have been wounded.
A witness told Reuters the assailant was detained by police.
Before the shooting, the alleged offender had approached reporters, saying he had been waiting since early morning and hoped Mr Dundar would be found guilty. His motives and background were not immediately clear.
"We experienced two assassination attempts in two hours: one by firearms, the other by law," Mr Dundar told reporters following the trial. "I have no doubt that the orders of the highest office played a role in this ruling."
The two are free pending appeal. The court also decided to postpone a hearing on separate charges of links to a terrorist group until the outcome of a related case.
No one was immediately available for comment at President Erdogan's office after the ruling.
Mr Dundar and Mr Gul had faced up to life in jail on espionage and other charges for publishing footage purporting to show the state intelligence agency taking weapons into Syria in 2014.
Mr Erdogan had accused the men of undermining Turkey's international reputation and vowed Mr Dundar would "pay a heavy price", raising opposition concerns about the fairness of any trial.
"We say the incident we covered was a crime, not our coverage," Mr Dundar said. "And for that we were confronted by the president. He acted like the prosecutor of this case. He threatened us and made us targets."
Under the ruling AK Party, which was founded by Mr Erdogan, Turkey has seized control of opposition newspapers and broadcasters and cut the satellite feed of a pro-Kurdish channel, accusing them of terrorism-related activities.