Joy Davies, the Liberal Party candidate in the B.C. riding of South Surrey-White Rock, has resigned after pro-pot comments she made on Facebook came to light during the federal election campaign.

Her resignation, announced by the party on Thursday afternoon, comes after Liberal Leader Justin Trudeau said Davies's promotion of the merits of marijuana does not reflect official party policy or his personal beliefs.

In 2013, Davies commented on Facebook that marijuana reduces family violence and that growing it in a home poses no harm to children. She also wrote that the Canadian Cancer Society is "another outlet for big pharma."

The Liberal Party said in a statement that Davies's views "in no way reflect" the values or policies of the party, and that a new candidate in South Surrey-White Rock would be nominated in due course.

In a Facebook post Thursday, Davies said she decided to resign because her "personal opinion and past comments should not distract from what is most important right now — ensuring all Canadians receive the real change and new leadership they deserve."    

Davies becomes the latest in a growing list of potential politicians exposed for past indiscretions on social media. Political operatives and average Canadians have dredged up plenty of questionable comments from the past as a tool to discredit current candidates.

Trudeau pot stance 'totally irresponsible': Harper

It also put the spotlight back on Trudeau's call for the legalization of marijuana.

Pressed about Davies at a campaign stop earlier in the day, Trudeau said Liberal policy would be to control and regulate marijuana, because right now it is in the hands of organized criminals, street gangs and gun-runners. It has also become far too accessible for young Canadians, he added.

The Conservative campaign insists the Liberal legalization plan would put the health and safety of children and communities at risk.

Conservative Leader Stephen Harper, speaking at a campaign event Thursday in Saint John, N.B., said Davies's remarks show how "irresponsible" Trudeau's stance on marijuana is.

"A Liberal candidate saying today that pregnant mothers should smoke marijuana, this is the kind of thing that comes with Justin Trudeau's advocacy for the full legalization of marijuana," Harper told supporters.

"And it is totally irresponsible and we will not stand for that."

With files from Kathleen Harris and Tom Parry