But polling has shown Mr. Trump’s political appeal receding in the district, and a Monmouth University poll published on Monday found that his approval rating there was 49 percent — identical to his disapproval rating.
Mr. Lamb may also benefit from the Democratic enthusiasm seen in special elections since Mr. Trump’s victory, as angry voters on the left turn out to send a message of opposition to the president.
If Mr. Trump cannot deliver victory for Republicans in a district like this one, there may be few places for him to campaign helpfully in the fall. During a long and unfocused speech on Saturday night, Mr. Trump appeared aware of the personal stakes. “I hate to put this pressure on you, Rick,” he said. “They are all watching because I won this district, like by 22 points.”
Lamb’s Pelosi Playbook
Republicans have battered Mr. Lamb with a familiar set of attacks meant to disqualify him with conservative-leaning voters. Most of all, they have tried to tie him to Nancy Pelosi, the House Democratic leader, who is intensely unpopular in districts like this one. Should Mr. Saccone prevail, it could be a testament to the enduring power of an attack Republicans have deployed every two years for a decade.
But Mr. Lamb has said that he would not support Ms. Pelosi for speaker of the House — and if he wins, other Democrats in Trump country might feel free to make the same pledge. When Republicans began airing Pelosi-themed ads, Mr. Lamb responded with a blunt commercial of his own. “I’ve already said on the front page of the newspaper that I don’t support Nancy Pelosi,” Mr. Lamb said.
Mr. Lamb has broken with the national Democratic Party in other ways, too, declining to support new gun regulations and downplaying his disagreements with Mr. Trump. If that approach works, it would probably embolden other moderate Democrats to go their own way in deep-red areas, and perhaps encourage candidates across the board to distance themselves from Ms. Pelosi as a partisan lightning rod.
Two Americas in One District
While it was historically steel-and-coal country, this district, like much of greater Pittsburgh, is more complex than the caricature drawn from its hard-hat past. Part of the reason this race has become so competitive is that the district includes affluent enclaves, like Upper St. Clair and Mt. Lebanon, that have previously gone Republican but are now uneasy with Mr. Trump, as voters are in other upscale suburbs across the country.
These communities, home to a swath of Pittsburgh’s professional class and more than a few of the city’s professional athletes and coaches, will have to vote overwhelmingly for Mr. Lamb if he is to have a chance to win. He will need those votes to offset the more rural and Republican-leaning parts of the district, in the counties on the West Virginia border and in areas closer to Johnstown, Pa. This terrain is more unambiguously Trump country, and more closely resembles the western Pennsylvania conjured by the film “The Deer Hunter.”
The district is not going to be around much longer. The state Supreme Court threw out the state’s current congressional map as an unfair partisan gerrymander, and adopted a new map last month with very different district boundaries. Whoever wins on Tuesday will have to decide soon which new district to run in for the next election in November.
The Role of Unions
Mr. Trump would not have carried Pennsylvania and other parts of the industrial Midwest in 2016 had it not been for the support he drew from rank-and-file union members.
To try to lure many of those Trump voters, Mr. Lamb has highlighted his military service, voiced support for the president’s steel tariffs, and generally done all he could to avoid the liberal label.
It was not by happenstance that Mr. Biden, with his ties to organized labor, was the only major national Democrat with whom he campaigned. Laying hands on Mr. Lamb at a union carpenter’s facility recently, Mr. Biden offered a succinct bit of testimony: “He is not afraid to say the word ‘union.’ ”
If Mr. Lamb prevails, it will probably be in large measure because he recaptured some of the unionized workers who have been drifting away from the Democrats. And Republicans know it: As part of their final push in the race, the leading House Republican “super PAC” created a digital ad made to look like a cable television news report portraying Mr. Lamb as supposedly reaching a “boiling point” with labor unions. The headline on the screen says “Democrat Abandons PA Unions,” as the ad makes note of Mr. Lamb saying he opposes raising the minimum wage to $15 an hour.
The Onslaught of Money
If Mr. Saccone wins, it will probably be because of the district’s Republican lean and the torrent of money from outside conservative groups, an extraordinary investment to protect a safe seat even if it were not being redistricted out of existence.
The spending has illustrated both the advantages the political right enjoys and the challenges it faces in the midterm elections.
Republicans can rely on a constellation of well-financed outside organizations to step in, as they did in this race, when their candidate is unable to match a Democratic opponent’s fund-raising.
But the groups’ attempts to derail Mr. Lamb’s campaign have also demonstrated how difficult it is to for Republicans to find an effective message. Though they have attacked Mr. Lamb on issues ranging from taxes to immigration to his record as a prosecutor, the race has remained competitive.