A California ballot initiative aimed at reining in rising prices for prescription drugs was headed for defeat on Tuesday after pharmaceutical companies spent more than $100 million to fight it.

The California Drug Price Relief Act, also known as Proposition 61, sought to limit state health programs from paying more for medications than the U.S. Department of Veterans Affairs (VA), which receives the steepest discounts in the country.

As of late Tuesday night, with 47 percent of precincts partially reporting, the vote was 46 percent in support of the measure and 54 percent opposed, according to California's Secretary of State.

"The pharmaceutical companies spent a lot to defeat this," said Stuart Schweitzer, professor of health policy and management at the University of California, Los Angeles Fielding School of Public Health. "They wanted to draw a line in the sand."

The rising cost of prescription drugs has come under attack during the recent U.S. presidential campaign. Both Democratic candidate Hillary Clinton and Republican Donald Trump have called for cost-trimming measures including allowing Medicare, the federal health plan for seniors, to negotiate prices with drugmakers.

"This strong vote for Prop 61, even despite the barrage of drug company campaigning against it, provides momentum for state legislation to rein in prescription drug prices," Anthony Wright, executive director of advocacy group Health Access California, said in a statement.

Pharmaceutical companies, concerned about their bottom lines, spent heavily on ads urging "no" votes, making this California's most expensive initiative contest among the 17 in this election.

Opponents, led by global drugmakers such as Pfizer Inc and Amgen Inc, spent around $106 million to fight Proposition 61. They argued that the measure would benefit only 12 percent of Californians, while putting the other 88 percent, as well as veterans across the country, at risk of higher drug costs.

More on this...

Supporters, led by the AIDS Healthcare Foundation and AARP, which advocates for seniors, said only drug companies themselves can raise prices for veterans or other consumers. Vermont Independent Senator Bernie Sanders also campaigned in support of Proposition 61, calling on voters to "stand up to the greed of the pharmaceutical industry."

Proponents, who raised $17 million to support the measure, estimated it could save California taxpayers up to $5.7 billion over 10 years, although a state legislative analysis said the financial impact is not clear.

UCLA's Schweitzer said the measure would have had only a modest impact on state drug costs.

There were also questions about how Proposition 61 would be implemented. The VA's mandated prices are listed publicly, but its steepest negotiated drug price discounts are required by law to be confidential.

The VA spends some $6.1 billion a year on medicines for 6 million veterans. Proposition 61 would extend those discounts to around 4.5 million Californians, including certain members of the state's low-income Medicaid plan, state employees and retirees, university teachers and prisoners.

The "Yes on Prop 61" coalition said it plans to carry its message to other states. A similar proposition has already been approved for Ohio's 2017 November ballot.