ST. JOHN'S, N.L. -- Canada's top judge says access to justice for poor and marginalized citizens is the biggest challenge to the legal system.

Nothing is more precious than a person's liberty, Chief Justice Beverley McLachlin told a public lecture at Memorial University in St John's, N.L., on Thursday.

"We have a justice system to be proud of but it does not always do the job it was created for," McLachlin told a standing room only audience.

"We all have heard criticisms of the justice system for occasionally producing a wrongful conviction.

The second annual Francis Forbes law lecture was one of her last public speeches as she gets set to retire in mid-December after 28 years on the Supreme Court of Canada and almost 18 years as chief justice.

McLachlin said while health and education spending have increased, spending on the justice system has been stagnant or declined across Canada in recent decades.

Yet she says various studies show that rehabilitating offenders pays off economically.

She says the five most pressing challenges for the criminal justice system are: access to professional legal assistance, access to prompt trials, access to fair sentencing, access to a system that meets victims' reasonable expectations, and access to a system that's culturally appropriate.

The latter is especially vital for aboriginal people who are disproportionately incarcerated, McLachlin said.