A man who was caught red-handed trying to pass a package of marijuana to a prisoner in provincial court has been given a 15-month sentence, to be served in the community.

According to a decision recently published in an online legal database, Elcid Terrance Agecoutay pleaded guilty to trafficking in cannabis.

The judge noted that Agecoutay was in provincial court in Wakaw on May 10, 2011 as a member of the public.

A prisoner was seated near the front of the court and, according to the decision, Agecoutay slipped that man a package containing 1.5 grams of marijuana.

The police noticed this and acted quickly, seizing the package and charging Agecoutay.

In sentencing Agecoutay, the judge remarked that his attempt to pass the drugs was not particularly bright.

"It was an unsophisticated and unprofessional plan, where the accused simply handed the item to the prisoner in front of the police and court," the judge said.

According to the judge, Agecoutay, 28, believed handing the drugs to the prisoner would help him to sever his ties with a gang.

The judge noted he had 42 previous convictions but had been out of trouble for almost two years.

"While I recognize his lengthy criminal record and his many breaches of conditions in the past, Mr. Agecoutay has been working on a new future, free of gang and criminal activity," the judge said. "I find that his serving a sentence in the community would not endanger the community."

While the judge was not impressed that drugs were passed in open court, the officers on hand were very observant and responded quickly.

"While the court does not condone his behaviour, one can understand it when viewed against the background of chaos and criminal behaviour that was his past," the judge said.

Agecoutay was given 15 months, with the first nine months on electronic monitoring and the final six months to be served in the community.