Mark Hague, 52, was escorted from the line and later arrested after a concerned mourner heard his comment in Victoria Tower Gardens on Saturday.
He appeared at Westminster Magistrates’ Court on Monday to plead guilty to a charge under Section 5 of the Public Order Act.
Prosecutor Louise Burnell said a television crew, interviewing one of the hundreds of thousands of people who waited in line to pay their respects to the Queen, asked what they were going to do once they got into Westminster Hall.
“A male, now known to be Mr Hague, was heard saying, ‘I will tell her to get out of her f***ing coffin because she’s not dead’,” she said.
“The event organiser made a decision that Mr Hague should not remain in the queue and he was escorted out.”
The court heard Hague was arrested after he became abusive to police officers and members of the public as he was led away from the scene.
He was held in custody and appeared in the dock wearing a grey sweatshirt and jeans, speaking to confirm his name, date of birth and that he was of no fixed address, before pleading guilty to the charge of using threatening or abusive words or behaviour.
District Judge Neeta Minhas fined Hague £120, which was deemed served because of the time he had spent in custody.
She imposed a further £120 as he was the subject of a conditional discharge for a previous assault on an emergency worker.
His lawyer Giovanna Fiorentino said: “He is clearly someone who is suffering from mental health problems.”
Another man, Muhammad Khan, 28, who was charged after allegedly leaving the queue to approach the Queen’s coffin in Westminster Hall on Friday night, also appeared at the same court on Monday, which did not sit for the duration of the state funeral.
The live feed from inside the hall cut away briefly at the time of the alleged incident at around 10pm.
Khan, from Limehouse, east London, was charged on Saturday with an offence under Section 4A of the Public Order Act, which alleges he used threatening, abusive or insulting words or behaviour to cause harassment, alarm or distress to a person or persons unknown.
Richard Brown, defending, asked for the case to be adjourned to Tuesday for mental health assessment to be carried out before his client enters a plea.
District Judge Nina Tempia granted the request and remanded Khan, who spoke to confirm his name, date of birth and that he was of no fixed address, in custody ahead of the hearing.
The charges are the latest relating to the queue to see the Queen’s coffin lying in state, which saw hundreds of thousands of people filing through Westminster Hall between 5pm Wednesday until Monday morning to pay their respects after waiting for hours along the banks of the River Thames.
Adio Adeshine, 19, allegedly exposed himself and pushed into mourners from behind as they waited in the line at Victoria Tower Gardens on Wednesday.
He is said to have gone into the River Thames in an attempt to evade police before coming out and being arrested.
Adeshine was remanded in custody on Friday after appearing at Westminster Magistrates’ Court charged with two counts of sexual assault and two counts of breaching a sexual harm prevention order.