CORAOPOLIS, Pa. (AP) — President Donald Trump waded into a potentially risky race on Thursday, throwing his support behind a Pennsylvania Republican in a contest widely viewed as a test of whether his party can stave off Democratic 2018 gains.

Speaking at a Pittsburgh-area factory, Trump praised state lawmaker Rick Saccone as “a real friend and a spectacular man.”

And he told reporters he planned to come back to Pennsylvania — where he won in 2016 — to campaign for Saccone, who is trying to keep a House seat in Republican hands in the first congressional race of the year.

“I’ll be back for Rick, and we’re going to fill up a stadium and we’re going to do something really special for Rick. I look forward to it,” Trump said.

The White House had insisted Trump’s visit had nothing to do with politics. And indeed, the speech he delivered at H&K Equipment largely stuck to the script, touting the tax cuts he signed into law just before Christmas, and trying to turn the conversation back to his accomplishments after weeks dominated by distractions, including questions about his mental health and comments about immigration that some considered racist.

But hours before he left Washington, Trump made clear the visit had a second purpose.

“We will be going to Pennsylvania today in order to give my total support to RICK SACCONE,” Trump tweeted, adding: “We need more Republicans to continue our already successful agenda!”

White House press secretary Sarah Huckabee Sanders quickly sought to correct the record, insisting in a statement that Trump was going to Pennsylvania to talk about tax cuts, not to campaign.

A campaign event would require that taxpayers be reimbursed for some of Trump’s travel expenses. Trump’s re-election campaign reimbursed the Treasury $68,000 for political travel last year.

In his remarks, Trump said the tax cuts he’d signed into law were already boosting the economy and helping companies like H&K.

“We are coming back bigger and better and stronger than ever,” he said, speaking to workers flanked by construction equipment. “At the center of America’s resurgence are the massive tax cuts that I just signed into law.”

“The signs of America’s comeback can be seen at companies like this one, which just had its most successful year in its 35-year history,” he said.

He also praised companies that have been passing their tax savings onto employers, largely in the form of one-time bonuses.

“Nobody thought that the companies were going to step up and pay all of these great bonuses to people,” he said.

Saccone, a 59-year-old state representative, faces Conor Lamb, a 33-year-old lawyer and former Marine, in the March 13 special election to replace Republican Tim Murphy, who resigned last year after acknowledging an extramarital affair.

The election is shaping up as the next test of Democratic enthusiasm and GOP resilience in the Trump era and an early indicator of whether a midterm wave may be coming in November, as Democrats hope. The party that controls the White House traditionally loses seats in Congress in the following midterm election.

While Trump easily won the district in 2016, the Congressional Leadership Fund, a political action committee aligned with House Speaker Paul Ryan, R-Wis., has opened offices in the district with paid canvassers. Political groups bankrolled by the billionaire Ricketts family, owners of the Chicago Cubs, are also airing television ads on Saccone’s behalf.

As for Democrats, spokeswoman Meredith Kelly, at the national party’s House campaign headquarters, praised Lamb’s “long record of public service to our country.” But the party hasn’t included the district on its official list of GOP-held targets, which now includes 91 seats. Democrats must capture 24 GOP-held seats to regain a majority in the House.

In 2017, Democrats managed surprisingly competitive races in four special congressional races in heavily Republican districts, but lost all four.

Lamb must “run a perfect campaign,” said Mike Mikus, a Democratic campaign strategist who has run congressional races in the Pittsburgh area. “But it can be done,” Mikus added.

Registered Democrats outnumber Republicans in the district by about 70,000, a reflection of organized labor’s influence. But many of those union households embraced Trump’s populist, protectionist message in 2016.

Saccone has framed his candidacy as an extension of the agenda that propelled Trump to office.

“It’s only natural to have him come out to see his core constituency and have us celebrate his successes with him,” Saccone said.