Updated: 12:09 a.m.

Democrat Kathy Hochul scored an improbable victory Tuesday in western New York, handing an embarrassing special election loss to local Republicans while frustrating the national GOP establishment and its allies, who invested millions of dollars in the contest.

Hochul, who now takes the 26th district seat vacated by Rep. Chris Lee (R), earned 47 percent of the vote compared with 43 percent for Republican Jane Corwin with 97 percent of precincts reporting, according to the Buffalo News. Third-party candidate Jack Davis, who will be forever labeled by Republicans as the spoiler, earned 9 percent.

“Tonight we showed that voters are really willing to look beyond a party label and vote for the person and a message they believe in,” Hochul said in her victory speech. “And we showed that thousands and thousands and thousands of voters are more powerful than millions and millions of dollars in special interest money.”

Democrats cheered the outcome as the direct result of voter dissatisfaction with the House Republican budget plan, which Corwin supported and would fundamentally reshape Medicare. Republicans largely blamed the loss on Davis, a former Democrat who occupied the Tea Party ballot line and spent more than $2.5 million from his personal fortune on a campaign that ultimately siphoned votes away from Corwin.