The number of people charged with marijuana-related crimes in Canada last year was at the lowest level in 20 years, continuing a six-year downward trend as the legalization of the drug approaches.

According to police-reported crime statistics released Monday by Statistics Canada, about 13,800 people were charged with possession of marijuana in 2017, which will mark the last full year that pot will be illegal.

This compares to 28,000 people who were charged with possession in 2011.

The reason for the continued decline in charges is twofold, according to Mike Serr, the deputy chief of the Abbotsford Police Department in B.C. and chair of the drug advisory committee of the Canadian Association of Chiefs of Police.

"Police forces have been focused on the opioid crisis and all the public-health issues surrounding it," Serr said.

"And as we get closer to legalization, more police officers are using their discretion when dealing with minor infractions — especially [those] not involved with organized crime."

The biggest decreases occurred in the northern Ontario communities of Thunder Bay and the greater Sudbury area, where possession charges dropped by more than 40 per cent from 2016.

Only three metropolitan areas registered increases in possession charges: Barrie, Ont., Kingston, Ont. and Saguenay, Que.

The federal government announced last month that Canadians will be able to legally purchase and consume recreational marijuana by Oct. 17. Adults across the country will be allowed to:

Purchase fresh or dried cannabis, cannabis oil, plants and seeds for cultivation from either a provincially or territorially regulated retailer, or — where this option is not available — directly from a federally licensed producer.

Possess up to 30 grams of dried legal cannabis or its equivalent in public.

Share up to 30 grams (or its equivalent) of legal cannabis and legal cannabis products with other adults.

Cultivate up to four plants at home (four plants total per household).

Prepare varying types of cannabis products (e.g., edibles) at home for personal use, provided that no dangerous organic solvents are used in the process.

The provinces and territories, however, will be responsible for the practical implementation of legalization. Quebec, for example, has passed a bill prohibiting the home cultivation of marijuana plants.

Other drug crimes are on the rise

While marijuana- and cocaine-related offences have fallen, all other drug-related crimes have been rising since 2010, said Warren Silver, an analyst at the Canadian Centre for Justice Statistics, a division of Statistics Canada.

Heroin-related crimes are at their highest levels since 1998, the earliest year recorded in the data. A total of 1,244 people were charged with trafficking that drug last year — nearly four times more than a decade ago.

Statistics Canada has also created a new crime category for the sale and possession of non-heroin opioids, like fentanyl, to better track the ongoing crisis. The first full year of data (2018) will be available next year.