Paramedics were called to a court after reports a defendant had cut his own throat in the dock.
Lukasz Robert Pawlowski, 33, was airlifted to hospital on Wednesday having previously pleaded guilty to sexual assault by grabbing and kissing a shop assistant, the Western Telegraph has reported.
A reporter from the newspaper was at the hearing at Haverfordwest Magistrates' Court in Pembrokeshire, west Wales, and said the courtroom was cleared out after the defendant "started slashing at his throat".
The reporter, who said they did not see what weapon was used, added: "I'm not sure if he lost consciousness but he did lose a lot of blood."
A spokeswoman for Dyfed-Powys Police said officers were called to the court at around 10.20am.
She said: "Officers attended and found an injured man at the scene, who was receiving treatment by paramedics.
"He has been conveyed to Morriston Hospital by air ambulance. The extent of his injuries are unknown at this time. The court has been closed in order for inquiries to take place."
The spokeswoman added police were not looking to speak to anyone else in connection with the incident.