U.S. Rep. Erik Paulsen, who has worked to distance himself from President Donald Trump during his competitive re-election race, got an unexpected tweet of support from Trump — a potential boost for his critics, who say Paulsen hasn’t done enough to stand up to his fellow Republican.

“Congressman Erik Paulsen of the Great State of Minnesota has done a fantastic job in cutting Taxes and Job Killing Regulations,” Trump tweeted at 11:22 p.m. on Monday. “Hard working and very smart. Keep Erik in Congress. He has my Strong Endorsement!”

Paulsen, a five-term congressman from Eden Prairie, is trying to hold his seat in the Third Congressional District, which spans Bloomington to Coon Rapids. Even as Paulsen has hung on, the district has backed Democrats for president three times over the past decade.

Paulsen said in a brief interview that he didn’t seek or request Trump’s endorsement.

“Trump is Trump, he’s going to do what he’s going to do,” Paulsen said, reiterating an earlier statement that he wishes the president would endorse his position to protect the Boundary Waters instead. He added about the late-night tweet: “I found out about it when everyone else did.”

Paulsen has said publicly that he didn’t vote for Trump in 2016, but rather wrote in Florida Sen. Marco Rubio. And throughout his campaign, he’s highlighted his opposition to mining near the Boundary Waters Canoe Area Wilderness, which Trump’s administration has supported. That was the focus of Paulsen’s first TV ad and his campaign fliers, which show a photo of him and his family paddling on a lake. It asserts that he “stood up to his own party to protect” the Boundary Waters.

“I’ve got a record of showing where I’m independent,” Paulsen said Tuesday.

This year, Paulsen skipped Trump’s rallies in Duluth and Rochester and Vice President Mike Pence’s visit to the Twin Cities for a Republican Party fundraiser — the only absent Republican member of the congressional delegation. He did attend a Minneapolis event with Pence last spring.

In recent days, he also hosted other Republican leaders including House Speaker Paul Ryan on Monday and Rep. Steve Scalise of Louisiana, the House Majority Whip, and Rep. John Shimkus of Illinois. Paulsen, Scalise and Shimkus are roommates in Washington.

“It’s a neck and neck race,” Paulsen told his volunteers last week, adding that his campaign is focused on reaching undecided voters. “Those are the folks that always make the choice in this district on which way it goes.”

In a Star Tribune/MPR News Minnesota Poll last month, 53 percent of suburban voters said they disapprove of Trump’s job performance.

“Congressman Paulsen can lie about being an independent voice all he wants, but the proof is in his record and his loyalty to Trump,” DFL Chair Ken Martin said in a statement.

Paulsen’s Democratic opponent, Dean Phillips, said Tuesday that Trump’s endorsement of Paulsen wasn’t a surprise.

“Donald Trump doesn’t endorse moderates,” Phillips said. “I suppose it’s Erik Paulsen’s reward for voting with President Trump 98 percent of the time.”

Phillips, a first-time candidate and businessman from Deephaven, has repeatedly disputed that Paulsen is moderate enough for the Third District or is a check on Trump. Phillips said he didn’t believe Paulsen’s response to Trump’s tweet and believes it was coordinated.

“Paulsen is on the side of the president, not of the district he serves,” Phillips said, adding that he vows if elected to be a check on the executive branch.

In TV ads, Phillips has touted that Democrats, Independents and Republicans are supporting him. He’s also launched a video series of former Paulsen supporters who are backing him.

Trump is perhaps a bigger factor in the Third District than other districts because, while voters have elected Republicans to Congress since 1961, Barack Obama and Hillary Clinton won the district in the 2008, 2012 and 2016 presidential elections. That’s left Paulsen and Phillips arguing over who’s moderate enough for the district. Jim Ramstad, a Republican who held the seat before Paulsen, was known as a moderate who occasionally turned against his own party’s agenda.

Amanda Peterson, 23, of Victoria, a University of Minnesota student who has volunteered on Paulsen’s campaign and voted for Trump, said Paulsen has worked with Trump on issues such as federal tax cuts while countering him on issues such as the Boundary Waters.

“Stylistically, they couldn’t be more different. Paulsen is mild-mannered and Minnesotan. And Trump definitely is not,” Peterson said. “He’s with Trump when it helps us. And he’s not afraid to stand up to him when he needs to.”

But Gretchen Haynes, 48, a stay-at-home mother in Eden Prairie, disagreed. Describing herself as an independent, she said she voted for Paulsen in 2016 because “he seemed like a nice enough guy,” she liked that he attended the same college as she did — St. Olaf — and she was a ticket-splitter, supporting Paulsen and Clinton. After Trump won, she started looking more closely at Paulsen’s votes.

“He’s voting for things I don’t agree on,” she said. “He says he’s a moderate, but he’s obviously just aligning himself with the Tea Party extremists.”