Rep. Lou Barletta, R-Pa., walks down the House steps at the Capitol in Washington, D.C.

President Donald Trump and a Republican candidate he backs hope to take a first step Tuesday toward flipping a Senate seat in swing state Pennsylvania.

The GOP faces a challenge in its push to unseat Democratic Sen. Bob Casey.

Rep. Lou Barletta, who endorsed Trump's presidential campaign in March 2016, will face state Rep. Jim Christiana in Tuesday's Pennsylvania Republican Senate primary. The winner will get to face Casey, one of 10 Democratic senators seeking re-election in states Trump won in 2016. Casey, running unopposed Tuesday, is considered one of the safer senators in the group, as the president only narrowly won Pennsylvania.

Barletta, 62, has tried to channel Trump's immigration and economic rhetoric to capture the president's success in the purple state. But taking down Casey, a well-funded second-term senator, could prove difficult even with the president's support.

Barletta — who represents the state's 11th District in eastern Pennsylvania — will first have to get past Christiana this week. He appears to have a good chance of doing so.

Barletta raised about $3 million during the race, compared with about $275,000 for the state representative. Barletta has another factor going for him that GOP congressmen who fell short in bids for the Senate last week lacked: Trump has publicly supported him.

In a February tweet, Trump called Barletta "strong" and "smart" and noted he was one of the president's "very earliest supporters." He said the congressman voted for the GOP tax overhaul, "unlike Bob Casey."

Trump is pushing to give Barletta another boost before Tuesday, recording a robocall endorsing the congressman. It started going out Saturday and will get sent Monday, as well.

"Tuesday is Election Day, and I need you to go out and vote for my good friend, Lou Barletta, a very special guy," Trump said in a recording of the call, obtained by CNBC.

Trump tweet: Rep. Lou Barletta, a Great Republican from Pennsylvania who was one of my very earliest supporters, will make a FANTASTIC Senator. He is strong & smart, loves Pennsylvania & loves our Country! Voted for Tax Cuts, unlike Bob Casey, who listened to Tax Hikers Pelosi and Schumer!

Earlier this month, Trump took another swing at Casey as he pushed gun rights supporters to elect more Republicans in the Senate to support his agenda. He criticized Casey, among other Democratic senators, for voting against his immigration priorities.

Barletta, who has served in Congress since 2011, was pledging to crack down on immigration well before Trump started running for president. He has taken a hard line since he served as mayor of Hazleton, Pa., in the early 2000s. He put rules in place to financially punish landlords who house undocumented people or businesses who employ them.

Barletta has supported GOP efforts to defund so-called sanctuary cities — a push both he and Trump have criticized Casey for opposing.

The congressman has also touted his support for the GOP tax overhaul. Barletta has criticized free-trade deals like the Trans-Pacific Partnership — but voted along with many Republicans in 2015 to give President Barack Obama fast-track authority to negotiate the agreement.

Christiana, who represents a western Pennsylvania district in the state House, contends both Barletta and Casey have had their chance in Washington and failed. He has argued for fiscal restraint and criticized both lawmakers for supporting the massive omnibus spending bill to fund the government through September. Trump signed the spending bill into law in March, despite threatening to veto it.

Though appealing to voters as an outsiders sometimes works in elections, Christiana appears to be an underdog heading into Tuesday.