Democrat Jared Golden defeated incumbent GOP Rep. Bruce Poliquin after votes have been counted in Maine's controversial ranked-choice voting system, according to election officials.

Golden's win comes after Poliquin, the two-term incumbent, technically received the most votes in the first round of the system. Poliquin led with 46.3 percent of votes compared to Golden’s 45.6, according to unofficial results, the Bangor Daily News reported.

Because no candidate garnered more than 50 percent of the vote, the ranked-choice voting (RCV) method kicked in. Under this system, if no candidate receives a majority, then votes are counted in rounds with the lowest-ranked candidate eliminated per round until only two remain in a mathematical game of survival. For example, once a candidate is eliminated, the second-choice picks for voters who chose that eliminated candidate will then be counted as the remaining contenders move on to the next round. This process continues until only two candidates remain, with one receiving the majority of the vote – and declared the winner.

About 8 percent of voters chose two independents in the first round for the 2nd congressional district race: Tiffany Bond and Will Hoar. After another round of voting, Poliquin lost by less than 3,000 votes, according to election officials.

Earlier this week, Poliquin sued the Maine secretary of state, claiming the RCV system has “undermined” constituents’ voting rights. U.S. District Judge Lance Walker heard arguments in the case Wednesday but declined to intervene and stop the process. However, because he didn't rule on the constitutionality of the RCV system, Poliquin's lawsuit is still valid.

MAINE REPUBLICAN CONGRESSMAN SUES OVER 'FLAWED' RANKED-CHOICE VOTING SYSTEMS AS BALLOTS ARE STILL COUNTED

“Instead of respecting this important constitutional principle, the RCV Act directly contravenes it by denying individuals who obtained the highest number of votes after the first round of balloting – in this case, Bruce Poliquin – from being declared the winner of the general election,” the suit claims.

In a victory speech, Golden said Maine voters showed they "want a new generation of leaders who will fix our dysfunctional political system so that it serves the people first and foremost," according to the Bangor Daily News.

“This is exactly the way ranked choice voting empowers voters,” Rob Richie, FairVote president and CEO, said in a statement provided to Fox News. “The voice of every voter should matter. We now know which candidate most 2nd Congressional District supporters want to represent them in Congress for the next two years.”

Maine is the first state in the nation to use the system – though it wasn’t used for all races in the Nov. 6 election. It was used for the U.S. Senate race (with incumbent Angus King winning re-election) and the U.S. House races for the 1st and 2nd congressional districts. It was not used in the gubernatorial election, among others, because of concerns it runs afoul of Maine’s Constitution.

REPUBLICANS WHO WON'T BE COMING BACK TO CONGRESS AFTER 2018 MIDTERM ELECTIONS

There was no controversy in Maine's other House race and Senate race. Democratic Rep. Chellie Pingree and independent King each won with a majority of the vote, making further tabulations unnecessary.

Democratic governor-elect Janet Mills has promised to seek to amend Maine's constitution so the system can be used in all elections.

The Associated Press contributed to this report.