James Ainsworth is said to have been set upon during a break in his trial at the High Court in Glasgow on Wednesday afternoon.
The 61-year-old received CPR in the street from paramedics following the incident. Mr Ainsworth was then taken to the city's Southern General Hospital, where he is in a critical condition.
A suspect is in custody and a judge has ordered an investigation into the incident.
Ainsworth, of Largs, Ayrshire, was on trial accused of a string of offences against a number of individuals dating to the 1960s. The case began on Monday and testimony was heard from several witnesses.
The attack is said to have taken place about 1pm during the lunchtime adjournment on Wednesday.
Police initially attended to Mr Ainsworth as he lay on the ground yards from the court's front door.
A man - thought to be the attacker - was escorted back into the building by two officers.
An ambulance arrived while the area was taped off.
One witness said: "Almost every court police officer was on the scene when it became apparent what was happening.
"The man on the pavement was not moving and was clearly in a very bad way. There were also items scattered nearby.
"Paramedics treated him on the street for about 30 minutes, including giving him CPR. Another man was also doing what he could to help."
It is not believed any weapon was used in the attack. Blood could still be seen yesterday at the area where the incident happened.
Reporting of the incident had been banned for 24 hours while a decision was made what to do with the case against Mr Ainsworth.
Prosecutor Kath Harper yesterday moved to halt the trial, stating it "seemed unlikely" Mr Ainsworth would be fit to attend court "in the near future".
Ms Harper said: "Mr Ainsworth is in intensive care at the Southern General. His injuries are life-threatening and he remains unconscious.
"He was put into a medically induced coma. Sedation was lifted and doctors are awaiting a reaction.
"Medical staff are unable to give any prediction for recovery."
The jury was discharged after Judge Lady Scott said Mr Ainsworth had to be taken to hospital for an "emergency admission".
She added: "This may come as a shock and I hope you do not find it too distressing."
Prosecutors can restart proceedings against Mr Ainsworth should he be fit to return to the dock.
Before the jurors had returned, Lady Scott said the events were a "matter of concern for the court". She earlier stated "security issues might arise" after what took place.
She told the court: "I will want to see a full inquiry and a report into what is happening."
Lady Scott said the matter had also been referred to the Lord Justice General, who also awaits the outcome of an investigation.
Police confirmed a 31-year-old man was in custody in connection with the attack. He is due to appear at Glasgow Sheriff Court today.