Vittorio Dominelli was called a "complete idiot" in court as he pleaded guilty to eating marijuana-laced chocolate he had stolen during a January raid.

Crown attorney Philip Perlmutter said the Toronto police officer and his partner, Constable Jamie Young, ate the chocolate while on duty.

Twenty minutes after consuming the chocolate, Dominelli requested medical help over his police radio.

A judge in Canada called a Toronto police officer a "complete idiot" as the officer pleaded guilty to stealing and eating a marijuana-laced chocolate bar he had seized in a raid.

Vittorio Dominelli, 36, resigned from the force last week, The Globe and Mail reported.

On Friday, he pleaded guilty to attempting to obstruct justice in connection to the marijuana incident in January.

Dominelli, a father of three, was part of a raid on an illegal marijuana dispensary on January 27.

He and his partner, Constable Jamie Young, pocketed the marijuana-laced chocolate bars as they left the dispensary to get pizza for the squad, according to a statement of facts read in court by Crown attorney Philip Perlmutter.

Neither Dominelli nor Young had ever tried cannabis before the raid, the court heard.

After the raid concluded, Dominelli and Young were ordered to conduct surveillance on an after-hours bar, where the partners decided to try the chocolate bars.

They consumed all eight squares of the chocolate bar while surveying the bar and became "severely intoxicated," the court heard.

Twenty minutes later, Dominelli made an emergency 10-33 call, which is police code in Canada for "officer needs assistance," and asked for an ambulance, Vice reported.

"My heart was pounding. I felt like it was going to come out of my mouth," Dominelli said in a statement submitted as court evidence. "I realized instantly what a stupid thing I had done. At that point, I did not care anymore about the prospects of getting caught or the professional consequences. I just wanted medical help."

Dominelli was taken to hospital, where he threw up and tested positive for THC.

His attorney is asking for a conditional discharge and 200 hours of community service for the obstruction of justice charge.

"The conduct here, you cannot describe as anything other than stupid," Justice Mary Misener said in court, adding that Dominelli is a "complete idiot."

Young has also been charged with attempting to obstruct justice as well as breach of trust, but the charges have not been proven in court.