The attacker fired the improvised gun twice at the defendant, who was standing between paramilitary policemen. The first bullet hit the suspect, Mehmet Emin Soylu, who lost the sight in his left eye as a result, the Anatolia news agency said. The second bullet injured no one.
The court was expected to issue a verdict in the retrial of Soylu, who faces charges of killing one person and wounding another in 2007 in a shootout at a car dealership.
The agency reported that the attacker's gun did not set off an X-ray machine at the entrance of the court house.
NTV television said identified the attacker on its website as the business partner of the murdered man.
"They killed my brother and I killed them, nothing else happened," NTV quoted the attacker, identified as Hasan C, as he was escorted into a police vehicle.
The television said the improvised gun was capable of firing two bullets, one at a time. The attacker said he bought the weapon from a sailor, it reported.
ANKARA, Turkey - The Associated Press