The former governor defeated state auditor Matt Dunlap to succeed Jared Golden

In a midterm election that the Associated Press described as a landslide, Maine’s 2nd congressional District stands as the one Republican gain on the nationwide congressional map that did not depend on redistricting. Paul LePage, the state’s former two-term governor, won the seat over Democrat Matt Dunlap, and the AP called the race Thursday after officials finished the ranked-choice voting process to determine the winner.

It was far from a resounding victory. Even though President Donald Trump won the district by 9 points two years ago, it took a former Republican governor to squeak out a win over Dunlap, the Democratic state auditor.

Elsewhere, the midterm map moved in the opposite direction. Democrats have flipped 44 seats, according to the AP, and a handful of races have not yet been called. The only other congressional districts to go from blue to red — Texas’ 32nd congressional District and Tennessee’s 9th — flipped through redistricting efforts that made their electorates far more conservative.

LePage and Dunlap were competing to replace Rep. Jared Golden, a Democrat who is retiring from Congress. Golden had found success in the 2nd by running as a moderate willing to break with his party, but he announced last year that he would not run for a fifth term, saying he had “grown tired of the increasing incivility and plain nastiness that are now common from some elements of our American community.”

Dunlap conceded the race the week before the AP call, while LePage declared victory and has been in Washington for orientation for new members of Congress. “Paul LePage is already hard at work for the people of Maine,” said Brent Littlefield, a spokesperson for LePage.

Maine has only two congressional districts. The 1st, which includes Portland and the state’s wealthy coastal towns, is heavily Democratic. The 2nd takes in a few small cities and vast rural and forested areas, and is home to industries such as logging, potato farming and lobster fishing. It is more conservative than most of New England.

LePage served as governor from 2010 to 2018, with most of his two terms predating Trump’s presidency. He aligned himself with the president toward the end of his time in office, and the two men shared a brand of brash, conservative populism, according to the AP’s account. LePage once said he was “Donald Trump before Donald Trump became popular.”

The alignment had limits. LePage criticized Trump’s tariffs on Canada, a key trading partner for Maine, and expressed support for legal immigration.

In his victory declaration last week, LePage vowed to make the state’s interests a priority in Washington. “If it is good for Maine, I will work hard to make it happen. If it is bad for Maine, I will oppose it,” he said.