Washington (CNN) Democrat Jared Golden defeated Republican Rep. Bruce Poliquin in Maine's 2nd District House race -- flipping the seat after the state calculated its ranked-choice voting results.

It's the first time in the nation's history a federal race has been decided by ranked-choice voting.

Golden won 50.5% to Poliquin's 49.5%, Maine Secretary of State Matthew Dunlap told reporters Thursday afternoon. The flip means Democrats have picked up 33 House seats so far in 2018, with seven races still undecided. Democrats lead in five of those seven seats, all of which are Republican-held districts.

So far, the current balance of power in Washington come January will be 228 Democrats and 200 Republicans in the House.

The tabulation came hours after a judge denied Poliquin's request for a temporary restraining order. The Republican had called into question the constitutionality of the ranked-choice voting process, which Maine's voters approved in a 2016 referendum and used for the first time this year.

Read More