A prominent journalist has been sentenced to more than five years in jail, hours after he escaped an attack by a gunman at a Turkish court.
The Istanbul court found Cumhuriyet newspaper's editor-in-chief Can Dundar guilty of revealing state secrets and sentenced him to five years and 10 months in prison.
His colleague, the paper's Ankara representative Erdem Gul, was sentenced to five years behind bars for the same charge.
The case, which is widely viewed as a test for press freedom in Turkey, relates to the pair's reports on alleged government arms smuggling to Syria. The journalists were expected to appeal the verdict and remain free until the end of the appeals process.
Earlier, a gunman shouting "traitor" fired two shots at Dundar outside the court building. Dundar escaped unharmed, but Yagiz Senkal, a journalist working for private NTV television was injured in the leg.
"Today we lived through two assassination attempts," Mr Dundar told reporters after the verdict. "One was armed, the second was judicial."
He said the sentence aimed to silence the Turkish press and insisted journalism is not a crime. "This bullet, this decision will not intimidate us," he added.
Last year, Cumhuriyet published what it said were images of Turkish trucks carrying ammunition to Syrian militants. The paper said the images proved that Turkey was smuggling arms to rebels - a claim the government rejects.
Turkish President Recep Tayyip Erdogan and the national intelligence agency, MIT, were plaintiffs in the case. Mr Dundar accused the president of inciting violence by weighing in on the trial.
"The president acted as if he were the prosecutor of this case, he engaged in threats and blackmail, and he paved the way for an armed man to open fire," he said. "I hope that next time he'll think twice."
At the final hearing, prosecutors dropped the charges of espionage and aiding a terrorist organisation. On the charges of revealing state secrets, the judges deemed the pair guilty. It acquitted them on charges of planning a coup, the Dogan news agency reported.