TORONTO, Canada — Pot lovers are dreaming of July 10, the day Canada’s dope laws go up in smoke.

An Ontario judge has struck down key aspects of Canada’s marijuana laws, triggering a 90-day countdown when growing, possessing or smoking pot will become legal.

The April 11 court ruling gives the federal government three months to either reform the laws or appeal the ruling to a higher court.

At issue is a 2001 law that allows seriously ill Canadians to access marijuana for medicinal purposes. But Justice Donald Taliano found that the vast majority of doctors refuse to prescribe the drug. Patients are therefore forced to break the law, either by growing their own or buying it on the black market.

“Seriously ill persons who need marihuana to treat their symptoms are forced to choose between their health and their liberty,” Taliano, of the Ontario Superior Court, wrote in his ruling.

“If they choose their health, they must go to significant lengths to obtain the marihuana they need, including lengthy trips to purchase the drug, resort to the black market and living with the constant stress that at any time they could be subject to criminal prosecution,” the judge added.

These barriers to legal access, Taliano ruled, violate the constitutional right of seriously ill people to use marijuana if it helps relieve their symptoms. He therefore struck down the 2001 Marihuana Medical Access Regulations.

He also struck down sections of another law that prohibit the possession or growing of marijuana, since they could be used to prosecute patients forced to break the law to relieve their symptoms. The result is that anyone — whether seriously ill or not — will be free to smoke and grow pot in 90 days, which is the amount of time Taliano gave the government to fix the laws.

The landmark ruling resulted from an action brought by Matthew Mernagh, 37, who lives in the southern Ontario town of St. Catharines. He suffers from fibromyalgia, scoliosis, seizures and depression.

“He lives with constant pain,” Taliano wrote in his ruling. “Prescription medications have failed to provide adequate relief for his condition, and in many ways, they create additional problems. Marihuana, used medicinally, eases his symptoms and allows him to function.”

Earlier court rulings gave Canadians like Mernagh the constitutional right to medicinal marijuana and forced the federal government to pass the 2001 law. It requires Mernagh and others to obtain a government licence to legally buy or grow dope for medicinal purposes. To get the licence, patients need a doctor to sign an application form.

But associations representing Canadian doctors have for years insisted that their members don’t want to be “gatekeepers” for an unproven and untested drug that could leave them open to lawsuits if prescribed. Mernagh testified he spent years trying to find a doctor who would sign his form, only to be rejected every time.

The court also heard from a patient in British Columbia, who described being rejected by 37 doctors, and another from Alberta, who was refused by 26 doctors.

Unable to obtain a doctor’s consent for a licence, Mernagh eventually decided to grow his own marijuana, and was promptly charged by police. That’s when he launched his court challenge.

The judge placed the blamed squarely on the shoulders of the federal government, criticizing it for setting up a program that allowed doctors to block a patient’s right to marijuana.

An alternative, Taliano argued, is to allow other health practitioners, such as naturopaths or herbalists, to sign the application for medicinal marijuana. Another option is to create a national registry with the names of doctors who know about the medicinal effects of marijuana and are willing to sign the forms.

Health Canada, the government department that administers the program, told the court that 4,800 people in Canada had a licence for medicinal marijuana as of March 2010. It expected that number to grow to 6,000 by 2011.

But the court also heard that the need is far greater. Surveys indicate there may be some 400,000 people in Canada using marijuana for medical reasons — without the needed licence.

Taliano referred to Canadian court rulings that describe marijuana as “relatively harmless” compared to hard drugs and that note it has no history of recorded deaths from consumption.

The court ruling only applies to Ontario. But a federal law wouldn’t be worth the paper it was written on if it didn’t apply to Canada’s biggest province.

Prime Minister Stephen Harper has said little about the ruling as he campaigns for the May 2 federal election. It’s a good bet he doesn’t like it. Stiffer prison sentences for marijuana possession are part of his “tough on crime” electoral platform.

If the government chooses to appeal, the case would go to the Ontario Court of Appeal. The Supreme Court would be the final step.