An alleged thief on a so-called legal high collapsed in Belfast city centre minutes after stealing a box of chocolates, the High Court heard on Thursday.
Gerard Doyle then tried to bite one PSNI officer and spat in the mouth of another after he was revived, prosecutors claimed.
The 24-year-old, of Eia Street in Belfast, is charged with theft and two assaults on police.
He was granted bail but banned from taking any non-prescription drugs or legal highs.
Doyle was allegedly identified on CCTV lifting a £6 box of chocolates from a stand outside Thornton’s at Corn Market on May 8.
Kate McKay, prosecuting, said he went on to a nearby British Home Stores cafe before collapsing.
“He appeared to be under the influence of some substance and had the open box of chocolates beside him,” she told the court.
Paramedics and police were called to the scene, with Doyle allegedly attempting to bite one officer during a bout of aggression.
He continued to be violent after being taken into custody for interview, it was claimed.
Mrs McKay added: “He then spat again at a sergeant – the spittle went into the sergeant’s mouth.”
Doyle claimed to have no memory of the incident due to being on a legal high, the court heard.
Mr Justice Weatherup was told the accused was not fit to be questioned when first taken into custody.
He was held overnight, with police said to be so concerned about his condition that they woke him every couple of hours to check he was all right.
Defence counsel Barry Gibson said: “He had met up with friends and they had given him a legal high.
“He said as a consequence of taking that he was not in control of his actions.”
After hearing details Mr Justice Weatherup told Doyle: “The problem here is not so much that you lifted a box of chocolates; the problem is you were aggressive and hitting out at the police.”
However, the judge ruled that he could be released on bail to stay at a hostel approved by police.