A defendant who smuggled a blade into court cut his own throat moments after he was sentenced.
The 20-year-old suffered what police said were "serious lacerations" in the self-inflicted injuries at Kirklees Magistrates' Court in Huddersfield yesterday afternoon.
A security guard was slightly injured in the disorder which broke out when the defendant was sentenced to 16 weeks in jail.
According to the Huddersfield Daily Examiner newspaper, the blade was smuggled past security checks as it was hidden in cigarette papers.
People attending court are routinely checked and must pass through metal detectors after removing items such as keys, money and phones and placing them in a plastic tray to be examined by staff.
An investigation has now been launched into how the blade got through.
Inspector Mohammed Rauf of West Yorkshire Police said: "We can confirm that a 20-year-old man from Milnsbridge has sustained self-inflicted neck injuries while attending Huddersfield Magistrates Court.
"He was taken by ambulance to Leeds General Infirmary with serious lacerations to his neck.
"A security guard at the court also sustained minor injuries."
A spokesman for security firm GEOAmey said: "We can confirm that at approximately 2pm on Thursday 31 July an incident occurred at Kirklees Magistrates' Court.
"GEOAmey is working closely with Her Majesty's Courts and Tribunals Service and the Ministry of Justice to investigate this incident."
A spokeswoman for HM Courts and Tribunal Service said: "We are urgently investigating the circumstances of the incident."
According to the Huddersfield Daily Examiner, the defendant had been jailed by District Judge Michael Fanning after previously admitting assault and criminal damage charges.
Police and ambulances were called to the court and the defendant was wheeled out on a trolley.