Democrat Jared Golden has defeated Republican Rep. Bruce Poliquin in the race for Maine’s 2nd Congressional District, thus marking the first House race ever decided by a ranked-choice voting system.

With Golden’s victory, Democrats have now won 36 House seats. Five GOP seats remain uncalled. Golden earned 50.5 percent of all votes, while Poliquin — who is involved in a lawsuit against Maine’s secretary of state over the votes — received 49.5 percent. Ranked-choice voting is held in only a few states like Maine and California, typically when a large number of candidates compete even within the same party in races, and was used in this year’s primary elections. Through the system, voters can list as many candidates they want on their ballots in order of preference, or “rank.” Maine’s Republican Gov. Paul LePage has voiced his opposition to this voting system.

Golden’s triumph also marks a major one for Democrats because President Donald Trump won Maine’s 2nd District in 2016. This year, 19 other such districts that Trump carried two years ago have been won by Democrats, thus reinvigorating the party’s hope of a “blue wave.” According to some political pundits, Democrats could potentially win up to 40 House seats by the time all midterm results are revealed.

Poliquin said in an email that he wishes to continue with his lawsuit, in which he accuses Maine’s voting system of being unconstitutional. A federal judge on Thursday denied the GOP candidate’s request for an injunction to stop the tabulation of votes.

SLIDESHOW: DONALD TRUMP’S 30 CRAZIEST TWEETS

Golden initially trailed Poliquin by 0.9 percent in first-place votes but then led his Republican opponent after the ranked-choice votes were compiled.

Under Maine’s voting system, residents rank their preferred candidates in order to permit an “instant runoff” by tallying second-choice ballots from people who voted for last-placed candidates. This process then repeats until a candidate wins with more than 50 percent of all votes. This system is only utilized for federal elections, not for state legislative or governor’s races.

Both independent candidates on Maine’s 2nd District ballot — William Hoar and Tiffany Bond — reportedly told their supporters to select Golden before Poliquin as their second-choice vote, which gave the Democratic contender an edge in the second round of voting.