A teenager accused of violating a tomb in an Edinburgh graveyard cut the head from a corpse, the High Court in Edinburgh heard.
A visitor to the graveyard peers into the mausoleum
A 15-year-old, who cannot be named for legal reasons, said Sonny Devlin "was running aboot going mental with it."
Mr Devlin, 17, and the youth deny taking the remains of a body from its coffin, cutting off its head, playing with it and simulating a sex act.
They are also accused of breaking into the Mackenzie Mausoleum in Greyfriars Churchyard.
Mr Devlin, of East Claremont Street, Edinburgh, is charged with committing the offence while on bail.
The pair have denied the "violation of a sepulchre".
The mausoleum was named after Sir George Mackenzie of Rosehaugh, a former lord advocate, who died in 1691.
The 15-year-old said of Mr Devlin: "He went down he got the skull and I was standing at the door.
"The smell was horrendous. Sonny was running aboot going mental with it."
The youth added that Mr Devlin had pretended that the skull had performed a sex act on him.
Earlier, a 15-year-old schoolgirl broke down in tears in the witness box when shown a photo of the head.
She told the court how she and her boyfriend, the 15-year-old co-accused, had gone to the churchyard with some other people.
The accused have denied violating a sepulchre
The schoolgirl said Mr Devlin began talking to a group of teenagers, who showed him an earring.
"They said it was George Mackenzie's wife's earring," she told the court.
"One of them said: 'Sonny, do you want to go and get the head of George Mackenzie'. He said 'Yes'."
She said Mr Devlin - who had latex gloves and a knife - asked others to accompany him and the 15-year-old boy "just gave in".
She said they returned 20 to 30 minutes later with a blanket containing the head from a male corpse.
Mr Devlin later said that he had cut the head off, she said.
The schoolgirl said that the head rolled out when he dropped the blanket.
She ran away and hid behind a headstone while Mr Devlin "played" with the head.
"I was scared," she added.
The trial, before Lord Wheatley, continues.