SACRAMENTO, Calif. (AP) — A closely-watched effort to impose a new tax on tobacco to pay for cancer research in the nation’s most populous state has failed by less than a percentage point after remaining too close to call for more than two weeks. The measure failed by 50.3 percent to 49.7 with about 5 million votes cast, The Associated Press determined Friday. The measure was losing by about 27,000 votes with 150,000 ballots remaining to be counted; too few for the ‘yes’ side to pull ahead. Lighting up the airwaves with campaign ads, the tobacco industry was able to cut support for a $1-a-pack cigarette tax backed by cycling legend Lance Armstrong from a two-thirds majority in March to a dead heat on Election Day. Since the June 5 voting, Proposition 29 has seemed headed for defeat by razor-thin margins, generally trailing by less than a percentage point. Voters in coastal counties and the San Francisco Bay Area approved the measure, while most inland regions rejected it. Opponents of the measure, which would have used tax revenue to fund cancer research, raised $47 million to fight it, a large haul for even the most heated state races. By comparison, Jerry Brown spent about $36 million in his successful 2010 bid to become governor of California and Wisconsin Gov. Scott Walker and his allies spent $47 million to beat back his recall challenge. Armstrong and a coalition of anti-smoking groups raised about $12 million to bolster the measure. New York City Mayor Michael Bloomberg made headlines when he kicked in $500,000 to help offset donations opposing the measure from tobacco companies. While raising the price of tobacco has been shown to reduce smoking rates, especially in young people, campaign ads sponsored by tobacco companies instead focused on trouble the state could run into in trying to distribute the revenue, and claimed that research would be done outside California. The strategy didn’t just stir doubt in the minds of voters. Several major newspapers, including The Los Angeles Times, opposed the measure while expressing general support for such sin taxes and reluctance to side with tobacco companies. They argued that the revenue should go directly to the state, which now faces a $16 billion deficit. The result was reminiscent a 2006 California cigarette tax measure that led by wide margins in early polling until tobacco companies spent $66 million to defeat it with ads featuring physicians. California was once at the forefront of smoking restrictions and taxes, but the famously health-conscious state has not raised tobacco taxes since 1998. If the new tax had passed, California would still have had only the 16th highest tax rate in the nation. Some smoking foes said they are weighing the idea of tackling the issue in the state Legislature. The overwhelming majority of recent tobacco taxes have been approved in statehouses, not at the polls. But in California, where new taxes require a two-thirds vote in the Legislature, lawmakers have defeated more than 30 attempts to raise tobacco taxes in the last 30 years. Missouri voters are expected to weigh in on a tobacco tax increase in November and similar taxes are working their way through the legislative process in the Rhode Island, Massachusetts and Illinois.