Democratic Sen. Jon Tester thanks Trump in full page ad ahead of rally Tester is 1 of 10 Senate Dems up for re-election in states Trump won in 2016.

In anticipation of President Donald Trump's rally Thursday in Great Falls, Montana, the state's Democratic senator, Jon Tester, took out a full-page ad in 14 newspapers across the state.

But instead of excoriating or attacking the president, Tester instead offered these words: "Welcome to Montana & Thank You President Trump."

Tester's praise of the president was for his signature on 16 pieces of legislation the Montana Democrat either sponsored or co-sponsored, and the political maneuvering in what will be one of this cycle's most closely-watched Senate contests is unmistakable.

The campaign also released a radio advertisement touting the same message, with an auctioneer rattling off the 16 bills signed by Trump, and the Montana Democratic Party tweeted a clip earlier this week of Trump touting the bills Tester worked on.

The strategy is a particularly clear example of how Democrats are campaigning in red states where Trump's popularity mostly endures despite sagging poll numbers nationally.

One of ten Senate Democrats up for re-election in states Donald Trump captured in the 2016 election, Tester has the difficult task of maintaining his bipartisan appeal in the state even as President Trump is poised to launch a barrage of attacks in an attempt to boost his opponent, Republican State Auditor Matt Rosendale.

Trump was particularly aggrieved with Tester following his release of allegations that eventually led to the withdrawal of Dr. Ronny Jackson as the president's nominee to lead the Department of Veterans Affairs, going as far as calling for Tester to resign.

"I'm glad that the president has signed 16 of my bills into law, including legislation to hold the VA accountable, and deliver on our promises to first responders and rural Montanans," Tester wrote in a statement Thursday, "We need to continue to build on those successes. President Trump, I’ll clear my schedule for whenever you are ready to sit down and talk about how we can get to work for Big Sky Country."

Tester's communications director Chris Meagher told ABC News that the senator will be in the state Tuesday, holding a listening session in Billings on tariffs with agricultural producers and businesses, then "heading to the farm to plow down peas."

Tester and his wife Sharla still farm the land homesteaded by his grandparents near the town of Big Sandy, Montana, according to the Senator's campaign website.

Trump has been hitting the campaign trail with increased frequency in recent days, hitting a number of states where Republicans are hoping to flip seats and expand their razor-thin 51-49 majority in the U.S. Senate.

Last week Trump held a campaign rally in North Dakota, where he blasted Democratic Sen. Heidi Heitkamp as another "liberal" out of step with a conservative-leaning electorate.

"You need a senator that doesn't just talk like their from North Dakota, you need a senator that votes like they're from North Dakota," Trump told a crowd of supporters in Fargo, North Dakota, where he appeared with Heitkamp's general election opponent, GOP Rep. Kevin Cramer.

Like Tester, Heitkamp has attempted to tout her working relationship with Trump and was cautious in her response to the president's attacks.

"I don’t answer to a political party or president, I only answer to North Dakotans who deserve an independent voice in the Senate. That’s why I’ve always been eager to work across the aisle – including with the president – to get results for our state, and today’s rally hasn’t changed that," Heitkamp wrote in a statement following Trump's Fargo rally.

One complicating factor for Trump is the recent Supreme Court vacancy created by the retirement of Justice Anthony Kennedy.

Heitkamp and two other red state Democrats, Joe Donnelly of Indiana and Joe Manchin of West Virginia, voted for President Trump's first Supreme Court nominee, Neil Gorsuch, and figure to be key votes in the contentious confirmation hearings to come.

Trump met last week at the White House with Heitkamp, Donnelly and Manchin "as part of ongoing outreach to get views and advice from both sides of the aisle on this important nomination," according to a statement from White House Press Secretary Sarah Sanders.

Tester opposed Gorsuch's nomination, and Republicans were quick to paint his ad an attempt to distract from his opposition to other parts of President Trump's agenda, such as the Republican tax cut bill, which Tester and every Democratic senator voted against last year.

"Tester has spent the last 20 years in office cozying up to lobbyists and out-of-touch Washington liberals, and no phony last-minute newspaper ads are going to be enough to cover up for his constant obstruction of President Trump’s agenda," National Republican Senatorial Committee (NRSC) spokesman Calvin Moore said in reaction to the Tester ad.

President Trump's eldest son, Don Jr., campaigned for Rosendale last month, and also attacked Tester in an op-ed in the Great Falls Tribune newspaper earlier this week, writing that the Montana Democrats, "pretends he’s willing to work with President Trump to Make America Great Again, but his Chuck Schumer-approved, liberal record proves otherwise."

"Montanans can be sure of two things regarding their new jobs and pay raises. First, Jon Tester opposed the policies that made it happen. Second, he will continue to oppose these policies to thwart the President’s agenda,' Trump, Jr. continued.

President Trump is scheduled to speak at 6 p.m. EST Thursday night in Great Falls.