A ballot measure to lower prescription drug prices in California failed Tuesday after major pharmaceutical companies spent more than $100 million to defeat it.

Proposition 61, backed by progressive stars like Sen. Bernie Sanders (I-Vt.) and former Labor Secretary Robert Reich, aimed to regulate prices by prohibiting the state from purchasing drugs from manufacturers at a higher price than what the Department of Veterans Affairs paid.

Under federal law, the VA gets significant discounts on drugs. The discount depends on the agency’s negotiations with manufacturers, but is usually at least 24 percent off the wholesale price. The California measure would have extended those discounts to public employees and their families, retirees, the state’s prison system and Medi-Cal patients not on managed care plans, impacting roughly 5 million state residents.

Sanders, who hosted pro-Proposition 61 rallies across California and was featured in an ad for the campaign, argued the measure would curb price gouging by companies like Mylan, which infamously raised the price of EpiPens by 500 percent. Sanders is a fierce advocate of regulating drug prices, and has used the following he built during the 2016 Democratic primary to take on the industry. He appears to be getting results: Last week, one drug company’s stock price took a dip after Sanders tweeted about the rising price of an insulin drug it manufactures.

“We will not continue to pay by far the highest prices in the world for prescription drugs,” he said at a rally in Los Angeles last month. “The reality today is that the pharmaceutical industry has become a major health hazard to the American people.”

Opponents of the measure ― led by the Pharmaceutical Research and Manufacturers of America (PhRMA) ― argued the price cuts would benefit few Californians at the expense of many more.

Proposition 61 also faced opposition from some veterans groups, which worried that drug companies would simply charge the VA more to minimize profit losses. Other opponents argued the measure would create unnecessary bureaucracy, limit access and prompt drug companies to raise their prices on other consumers.

“The measure is a deceptive proposition that will increase drug prices, reduce access to medicines, while increasing red tape and taxpayer costs,” Veterans of Foreign Wars commander Dale Smith wrote in a San Diego Union-Tribune op-ed. “And Proposition 61 takes away a special benefit to veterans who have served our country.”

The measure’s text said the state would figure out the mechanics of enforcing it, which left many voters unclear on how Proposition 61 would actually work. California’s nonpartisan Legislative Analyst’s Office analyzed the measure, but was unable to determine its fiscal impact ― in part because it wasn’t possible to predict how drug manufacturers would alter drug prices in response.

The campaign was the most expensive ballot measure in the country this election cycle. The opposition campaign raised more than $109 million, largely from PhRMA-aligned companies. In contrast, the campaign in favor of the measure raised about $17 million.

Despite its defeat, proponents argued the campaign was an important step in challenging Big Pharma. And amid rising anger over the cost of drug prices, other states could explore similar measures in the near future.