Rob Kampia is executive director of the Marijuana Policy Project.

During the 2008 campaign, Barack Obama raised hopes among those who support medical marijuana by pledging to respect state laws on the issue. But his administration has reversed course and massively escalated the federal government’s attacks on medical marijuana businesses, most of which are legal under their states’ laws.

This is perplexing because medical marijuana is far more popular than Obama is. A Washington Post-ABC News poll from January 2010 found that 81 percent of Americans supported legalizing medical marijuana. A CBS News poll from October found that 77 percent of Americans support allowing doctors to prescribe marijuana for serious medical conditions. By contrast, the president’s approval rating last October hovered around 42 percent — and is currently about 47 percent.

The shift has been clear. Attorney General Eric H. Holder Jr. announced in March 2009 that the Obama administration would end the Bush administration’s practice of raiding medical marijuana providers that violated federal statutes. A memo from the Justice Department later that year said the department would not prioritize prosecutions of individuals acting in compliance with state medical marijuana laws.

Through 2010, that policy seemed to work. California, Colorado, Maine and New Mexico took steps to regulate the distribution of medical marijuana at the state and local levels. Other states had similar plans in the works.

But last year the tide turned. Obama’s Justice Department authorized a series of letters from U.S. attorneys across the country threatening to “vigorously” prosecute individuals acting in compliance with state medical marijuana laws. In some cases the U.S. attorneys suggested that government employees who help regulate their states’ medical marijuana systems could be prosecuted for “facilitating” a crime.

There was more. The IRS cracked down on medical marijuana dispensaries, refusing to allow them to deduct such standard business expenses as rent and payroll. Last September the National Institute on Drug Abuse refused to provide federally grown marijuana to a Food and Drug Administration-approved research protocol seeking to measure the extent to which marijuana helps combat veterans with their post-traumatic stress disorder. The Bureau of Alcohol, Tobacco, Firearms and Explosives outlawed gun sales to medical marijuana patients. And federal prosecutors in California announced that they would crack down on dispensaries across the state, saying that they intend to seize the property of landlords who lease space to these businesses that are legal under state law.

Last month Obama clarified his position on medical marijuana, saying on a late-night show that “we’re not going to be legalizing weed . . . anytime soon.” This after he had recently told an interviewer: “I never made a commitment that somehow we were going to give carte blanche to large-scale producers and operators of marijuana — and the reason is, because it’s against federal law. I can’t nullify congressional law.”

Simply put, Obama has become more hostile to medical marijuana patients than any president in U.S. history.

To put Obama’s implosion in perspective, consider what Texas Gov. Rick Perry (R) wrote in his 2010 book “Fed Up!”: “When the federal government oversteps its authority, states should tell Washington they will not be complicit in enforcing laws with which they do not agree. Again, the best example is an issue I don’t even agree with — the partial legalization of marijuana. Californians clearly want some level of legalized marijuana, be it for medicinal use or otherwise. The federal government is telling them they cannot. But states are not bound to enforce federal law, and the federal government cannot commandeer state resources and require them to enforce it.”

Perry also wrote, “If you don’t support the death penalty and citizens packing a pistol, don’t come to Texas. If you don’t like medicinal marijuana and gay marriage, don’t move to California.”

The five presidents from Richard Nixon through George H.W. Bush allowed medical marijuana research to proceed unhindered.

The three presidents from Jimmy Carter to George H.W. Bush allowed patients to apply to the federal government for waivers to use medical marijuana legally under federal law.

Obama appears to be to the right of Ron Paul, Gary Johnson, Ronald Reagan and even George W. Bush on this issue. It’s hard to imagine how this helps Obama politically, and it’s easy to imagine how forcing patients to purchase their medicine from an illicit provider instead of a regulated business hurts people who are suffering from cancer, AIDS and multiple sclerosis.