A gunman shot at Turkish journalist Can Dundar on Friday as he awaited a verdict in his espionage trial, Turkish media reported.

The Cumhuriyet's editor was shot at outside the court in Istanbul. He was reportedly unharmed and the attacker was arrested.

The attacker apparently shouted "traitor" and fired at least two rounds, possibly three.

Dundar said: "It was directly against me, I saw the assailant... I am okay... I don't know who or what it is. I only saw the gun had been pointed at me."

A journalist for NTV was reportedly shot in the leg.

Can Dundar after the attack (AFP)

Dundar is on trial with colleague Erdem Gul over a story that alleged Turkey was shipping weapons to militants in Syria.

Crowds of reporters were waiting outside court for the verdict in the closed trial, which was expected later today.

Gunshots can be heard on videos of the attack, and the alleged attacker can be seen holding a gun as a man grabs him.

Photos later show the alleged attacker on the ground.