Prominent Turkish journalist Can Dundar survived an "assassination attempt" on Friday outside a courthouse, where he and a colleague are on trial over a report on an alleged weapons shipment to Syrian rebels.
The gunman, who shouted "you're a traitor to your country" while firing at the Dundar, was quickly arrested without resistance, television footage showed.
Dundar, the editor-in-chief of the Turkish daily Cumhuriyet, was not injured in the attack, witnesses and a lawyer said.
He and his wife went back into the court building and the proceedings continued.
Broadcaster CNN Turk identified Dundar's attacker as man aged around 40 from the central Anatolian town of Sivas, but did not name him.
A Turkish journalist who was on reporting duty outside the court building was lightly injured by a grazing shot, CNN Turk said.
The attack came as the court was expected to reach a verdict in the trial, which could see the two journalists facing life in prison on charges of espionage, treason and working with a terrorist organization.
Dundar said the "assassination attempt" took place as he was waiting for a ruling outside the courthouse. "All I saw was him pointing the gun at me," he said.
Ahead of the court session on Friday, Dundar had defended his newspaper's reporting on Turkey's alleged arms shipments to Syria, while also criticizing the Turkish authorities.
"The actual crime is the subject of the report and what happened here, and those responsible for this crime should be brought to justice," the journalist said.
A lawyer for Dundar and his colleague Erdem Gul, had said earlier on Friday that he expected his clients to be cleared of charges.
President Recep Tayyip Erdogan, a plaintiff in the case along with the Turkish secret service, had promised the pair would pay a "heavy price."
Both Dundar and Gul spent three months in jail on remand before the Constitutional Court ordered their release in late February.
The trial began on March 25, with the public being excluded from observing proceedings, sparking outrage among leading human rights groups.
Turkey ranks 161 out of 180 countries in the Reporters Without Borders Press Freedom Index.