Two prominent journalists were sentenced to at least five years in jail for revealing state secrets on Friday, 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 the 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 spillover of violence from neighbouring Syria.The man shouted "traitor" before firing at least two shots in quick succession. A reporter covering his trial appeared to have been wounded.A Reuters witness said the assailant was detained by police. Before the shooting, he had approached reporters, saying he had been waiting since early morning and hoped 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," Dundar told reporters following the trial. "There will always be concerns 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 Erdogan's office after the ruling.