The solar energy ballot item known as Measure B went down to defeat Thursday, as election officials in Los Angeles finished their count of the remaining 49,000 mail-in, provisional and damaged ballots.

Sixteen days after the election, city officials announced that Measure B had fallen short of a majority, with 50.5% of voters opposing the plan and 49.5% in favor of it. The final count left the measure trailing by 2,644 votes.

The defeat dealt a blow to the hopes of Mayor Antonio Villaraigosa, who had spent $145,000 from a campaign committee on behalf of the measure and appeared in a blitz of television commercials promoting it. But it was also a setback for the International Brotherhood of Electrical Workers, whose top officials had proposed Measure B.