Boulder voters narrowly passed a historic ballot measure Tuesday that will allow the city to sever its ties with Xcel Energy and strike out on its own to start a municipal electric utility.

A companion tax designed to pay for the legal bills and consultants’ fees that the city will incur on the way to starting such a utility also narrowly passed early Wednesday morning despite trailing in preliminary results all Tuesday night.

As of 12:55 a.m. with an unofficial total of 82,724 votes counted, Boulder Question 2C, which allows for the creation of a municipal utility, passed with 51.8 percent of the vote — a margin of 933 votes.

Issue 2B, which will raise the existing utility occupation tax by $1.9 million annually, passed with 50.3 percent of the vote — a margin of 141 votes.

Earlier in the evening, when it appeared that 2B would fail, supporters of municipalization gathered at the Hotel Boulderado said that earning voter approval for starting a municipal utility was far more important than having voters pass the companion tax.

“Once we pass 2C, we don’t have to pass it again,” said Ken Regelson, who helped lead the campaign in support of municipalization. “It leaves the door open for us for finding alternate funding or we can delay a year and go back to voters (for a tax hike).”

David Miller — chairman of the Boulder Smart Energy Coalition, which campaigned against 2B and 2C — said Tuesday night that the close nature of the race shows that the community is divided on whether to municipalize, regardless of where the final vote count falls.

“It looks to me like the voters are not endorsing municipalization,” he said. “It was presented as the passport to clean energy, and I don’t think there’s any sort of resounding endorsement of that.”

An Xcel Energy official who was expected to comment on the election Tuesday night did not contact the Camera by 11:30 p.m.

The drive to form a municipal utility grew out of the city’s efforts to reduce its greenhouse gas emissions. In 2006, Boulder voters approved a carbon tax to fund programs that would help Boulder meet the Kyoto Protocol, which calls for a 7 percent reduction in greenhouse gas emissions below 1990 levels.

But despite the city’s efforts creating and implementing its Climate Action Plan, Boulder is not expected to meet its Kyoto goal. The city’s difficulty shaving carbon prompted some Boulder leaders and environmental activists to call for a change in where Boulder gets its electricity.

Now, Xcel gets about 60 percent of its electricity from coal, and local supporters of the city’s carbon-cutting efforts would like to see Boulder form a municipal utility that could eventually source more of its electricity from renewable energy.

Xcel Energy actively campaigned against the two issues, pouring about $950,000 into the fight. The four groups that campaigned in favor of municipalization collectively raised less than a tenth as much — about $87,500.

Even with a vote to move forward, it could take five years or more before the city is ready to start a utility. In those years, the city and Xcel would hash out how much the breakup would cost the city, including the price tag for buying Xcel’s local distribution system and the amount of money owed to Xcel for “stranded costs,” or investments made by the utility in anticipation of continuing to serve Boulder.

Initial estimates of what municipalization will cost vary from $290 million, according to the city’s consultants, to about $1.2 billion, according to Xcel’s consultants. The real costs will be determined by the courts and by the Federal Energy Regulatory Commission.

People on both sides of the issue said Tuesday night that continued citizen involvement will be critical over the next several years if 2C passes.

“It’s essential that all of the parts of the community stay involved at a high level,” said Leslie Glustrom, who has worked to pass the municipalization measures. “Our goal is to bring our community together, not split it apart.”