Republican state lawmaker Mike Dunleavy will become Alaska’s next governor after defeating Democrat Mark Begich, in a race that was marked by the independent incumbent seeking reelection, Bill Walker, dropping out in the final weeks of the campaign.

Dunleavy, who has served in the Alaska Senate since 2013, represents one of the few Republican pickups in the 2018 midterm elections. Alaska had a string of Republican governors before electing Walker in 2014. His tenure was marked by both the popular expansion of Medicaid under Obamacare and troubles with the state’s unique program that resembles a universal income, known as the Alaska Permanent Fund.

Related 4 winners and 2 losers from the 2018 midterm elections

For much of the year, it was a three-way race between Dunleavy, Walker, and the Democrat Begich, a former US senator and mayor of Anchorage. Democrats and independents feared that Walker, even with his low approval ratings, would split votes with Begich, which would allow Dunleavy to win with well under 50 percent of the vote.

Walker didn’t drop out soon enough to have his name removed from the ballot. But he did pull out of the race in late October and threw his support to Begich, a centrist like Walker who nevertheless criticized the current administration for cuts to the permanent fund and high property crime rates. It didn’t prove enough on Election Day, however, to stop the GOP from taking back the Alaska governor’s mansion.

Dunleavy ran on a “Make Alaska Safe Again” platform — explicitly emulating a Trump-like message and promising to cut taxes and spending while somehow still leaving the permanent fund untouched. Democrats fear draconian budget cuts with Dunleavy’s win. Walker warned specifically that Dunleavy would roll back Medicaid expansion, a pillar of the outgoing governor’s record, which covered 45,000 of the state’s poorest residents.

Opioids were a major issue through the campaign. Alaska ranks toward the top among states in drug overdose deaths. Medicaid expansion, which the Democrats and Walker fear Dunleavy will undo, helps provide addiction treatment for people who abuse opioids.

The opioid crisis is also linked to a surge in property crime, a focus for Dunleavy’s campaign. He could point to statistics like vehicle thefts, which rose to twice the 10-year average in 2017. He called Alaska “the most dangerous [state] in the country” and pledged to roll back the criminal justice reform bill the state recently passed. The overhaul sought to reduce the state’s prison population and cut costs but has proven controversial given the persistently high crime rates.