Republican Jason Rarick won a hotly contested special election for an east-central Minnesota state Senate seat Tuesday, flipping a district long held by Democrats to give his party more power in the state Legislature.

Rarick, a state representative from Pine City, defeated Democrat Stu Lourey 52 percent to 46 percent in the 11th Senate District. John Birrenbach of the Legal Marijuana Now Party captured about 2 percent of the vote.

Rarick succeeds former state Sen. Tony Lourey, D-Kerrick, who resigned to take a job as Gov. Tim Walz's Human Services commissioner.

The win means Republicans will expand their narrow majority in the state Senate by one vote. The new 35-32 split may make it more difficult for Walz and Democrats in control of the state House to pass proposals this session key to their agenda, including bills related to guns, health care and a gas tax. Republicans celebrated the shift in power late Tuesday.

"We're going to do great things in the Senate," Rarick said Tuesday night. "We are going to stop everything they are pushing through the House."

"Tonight we became 35 strong," Senate Majority Leader Paul Gazelka, R-Nisswa, tweeted, adding a smiley face emoji. "We are grateful to have you join the team!"

The high-stakes race led political parties and outside groups to target the seat, spending heavily and sending scores of volunteers to rally voters in what was expected to be a low-turnout election. Ballot delays reported in the district's many mail-only precincts complicated the four-week sprint to fill the seat.

Given those dynamics, Lourey, Rarick and their respective allies focused heavily on encouraging voters to head to the polls, even if they were planning to vote by mail, in the final stretch of the race.

Both Lourey and Rarick also made local ties a centerpiece.

Rarick was recently elected to a third term representing the southern half of the district in the state House. On the campaign trail, he emphasized his support for gun rights and abortion restrictions, as well as his background as an electrician. That past work helped him land endorsements from a handful of trade unions, which he also touted heavily in his communication with voters.

Lourey, meanwhile, focused on his Kerrick roots and work as an aide to Democratic Sens. Al Franken and Tina Smith. He also had support from some of the state's biggest political players, including Walz and leading labor unions.

The district, which covers all of Pine and parts of Carlton, Kanabec and St. Louis counties, has been represented by Democrats — and members of the Lourey family — for decades. As son and grandson of former state senators, Stu Lourey would have been the third generation to fill the seat.

Recent gains by Republicans in greater Minnesota, including President Donald Trump's double-digit win in the district in 2016, put the open seat in play.

Another special election will be held to fill Rarick's state House seat.