AUGUSTA — Democrat Jared Golden emerged as the winner of Maine’s 2nd Congressional District race Thursday, upsetting Republican Rep. Bruce Poliquin in a historic runoff that used ranked-choice voting.

Golden captured 50.5 percent of the vote to Poliquin’s 49.5 percent to become the first challenger to defeat an incumbent in Maine’s sprawling 2nd District in a century. The Marine Corps veteran and Lewiston lawmaker also made history by winning the nation’s first congressional election to use ranked-choice voting, enabling him to erase an initial deficit by securing the second- and third-choice votes of people who cast their ballots for two independents.

The final vote tally was 139,231 votes for Golden versus 136,326 votes for Poliquin, a margin of 2,905 votes.

However, Thursday’s ranked-choice voting results won’t be the final word on the 2nd District race, which was one of the most expensive in the country. Poliquin defiantly declared Thursday afternoon that he “won the constitutional ‘one-person, one-vote’ ” tally on Election Day and vowed to continue his lawsuit challenging the legality of ranked-choice voting.