Asking voters to slap a $1-per-pack tax on cigarettes to fund cancer research seems like a cinch in health-crazy California, where lighting up already is banned in bars, public buildings and on many of its golden beaches.

But the tobacco tax, pitched to voters under Proposition 29 in Tuesday’s primary, teetered on the brink of defeat Wednesday just months after opinion polls showed widespread support. The measure was trailing by about 63,000 votes, although still-uncounted ballots could number as high as 1 million, by some estimates.

The crumbling support coincided with a barrage of opposition ads, paid for as part of a $47-million opposition campaign bankrolled by Philip Morris USA and R.J. Reynolds Tobacco Co.

Interactive map: Prop 29 cigarette tax results

The ad that caused the biggest uproar featured a Northern California doctor, draped in a white lab coat, earnestly warning viewers that the tax money would be gummed up by a new bureaucracy “run by political appointees,” with not a penny going to treat cancer patients.

The American Cancer Society and cycling champ (and cancer survivor) Lance Armstrong, among the measure’s biggest supporters, cried foul.

“They were desperately trying to make Prop. 29 about something other than cancer and tobacco,” said Chris Lehman, campaign manager for Yes on 29. “With a lot of voters, they had success in doing that.”

Similar sentiments on a stream of glossy mail ads sent by the No side also clearly resonated. The ads quoted anti-tax advocates and newspaper editorials criticizing the measure, with the names of the tobacco companies buried in the fine print.

“Bureaucracy has become code for everything bad about government,” said San Jose State political scientist Larry Gerston. The tobacco company’s ads certainly had an effect, he said, but that was largely because “the audience was predisposed.”

Many voters bought the idea that Proposition 29 was more of a tax than a strategy to reduce smoking and cure disease. Maybe not a tax on them — only about 14% of Californians smoke — but a tax nevertheless. The money it generated, the tobacco industry said, would go to a financially inept state government that for many years running has had a multibillion-dollar budget deficit.

If Proposition 29 is defeated, as many expect, Californians will have rejected every tax increase on the ballot since 2004, when voters approved a 1% income tax increase on millionaires to fund mental health programs, said Jon Coupal, president of the Howard Jarvis Taxpayers Assn.

“Californians are not anti-government,” he said. “But they want value for their tax dollars, and they perceive correctly that they are not getting that in Sacramento.”

Taxpayers have soured on expensive new ventures that promise economic windfalls and easier daily lives, he said. They remember, he said, approving a $3-billion bond measure for stem-cell research, only to hear that outsized salaries were being collected by executives running the program. He said they remember passing a $9-billion state bond measure in 2008 to build a high-speed rail network, a project that has seen costs and roadblocks multiply.

He said that even if voters don’t, in the end, reject Proposition 29, they will have come close. That will not bode well for a critical part of Gov. Jerry Brown’s plan to rescue California from financial ruin: a proposed November ballot measure to raise the state sales tax and income levies on the wealthy.

“What makes Jerry believe they will support a massive tax increase which is far more broad-based?” Coupal said.

The last time state voters approved a tobacco tax was 14 years ago: a 50-cent-per-pack levy to fund childhood development programs. The measure passed by less than 1% of the vote.

“We were lucky that voters, at the time, saw through the lies of big tobacco,” said Los Angeles-based political consultant Chad Griffin, who worked on the 1998 campaign led by actor-director Rob Reiner. “But it was very close then, and it doesn’t sound so different now. These are never easy when you’re taking on one of the most well-financed industries in the world.”

Griffin said the cigarette companies have stuck to the same campaign playbook for decades: Blaspheme the measure as a tax increase, or the offspring of political cronies — anything to divert attention from the deadly effects of cigarettes.

“You’re talking about an industry that markets and sells a product, that when used as intended, causes disease and kills people,” Griffin said.

The Yes on 29 campaign, though outspent almost five to one, raised a respectable $12 million. But Armstrong said the coalition of anti-cancer crusaders relied heavily on new media — including blasts to his 3.4 million Twitter followers — to counter the No side’s financial advantage and its old-school tactics, television and radio ads and stuffing mailboxes.

The anti-29 campaign included anti-tax groups and business organizations as well as tobacco firms.

On Wednesday, Lehman was still hoping for victory.

“Our campaign has been [supported by] cancer survivors trying to beat cancer,” he said. “You have to keep fighting on, because that’s what they do. No matter what the odds.”

Interactive map: Prop 29 cigarette tax results

phil.willon@latimes.com