The campaign for control of Congress is suddenly playing out across a far larger swath of the country than either party had previously expected, with Tuesday’s special House election in the Pittsburgh suburbs showing how President Trump’s unpopularity is turning many once-safe Republican districts into battlegrounds in this year’s midterm elections.

GOP incumbents who have rarely, if ever, faced a viable challenger are being forced to build campaign operations, raise money and make more frequent appearances across their districts.

And Democrats who have long intended to make their stand in a few dozen evenly divided districts now say the results in Pennsylvania’s 18th Congressional District, which Trump carried by nearly 20 points two years ago, suggest the battleground may expand to more than 100 districts where the president’s margin was smaller.

Many of those newly contested races are starting to come into focus in suburbs where, like the neighborhoods outside Pittsburgh that backed Democrat Conor Lamb, mainstream Republican voters embraced Trump in 2016 but have been drifting away in recent months.

The new dynamic is apparent near Houston, where nine-term Rep. John Abney Culberson (R) has never faced a serious Democratic challenger but is furiously raising money and promoting his constituent work. His opponent, who will be chosen in a May runoff, will have plenty of cash for the November fight.

“I’ve always run as though I’m behind, because this job is a two-year lease,” Culberson said. “I’ve certainly stepped up my fundraising, but I’ve always kept in touch with my grass roots. I’m focused on helping hurricane victims recover and heal.”

Rep. Ralph Norman of South Carolina, facing a rematch against Democrat Archie Parnell, insists on sticking close to his district to campaign, even warning GOP colleagues to skip overseas congressional trips.

“I do town halls, I do tele-town halls, I do opioid conferences — it’s a people game,” said Norman, who argues that if an incumbent is “not in the district, you’ll pay a price.”

In the Midwest, South and West, Republican-held districts that had not appeared on the map in recent years, or ever, are in Democrats’ sights. The party capitalized on resistance to Trump to produce a robust class of recruits as it aims to erase the GOP’s 23-seat advantage and seize the House majority in November.

Democrats are monitoring, though are not yet involved in, two special elections to replace “safe seat” Republicans who resigned — one in the western suburbs of Phoenix and one in the northern suburbs of Columbus, Ohio.

In North Carolina, two Democrats — philanthropist Kathy Manning and Marine Corps veteran Dan McCready — have raised more money than Republican incumbents. Democrats see two opportunities in the Detroit suburbs, where new tariffs on steel are seen as risks for the auto industry, and three in Illinois, depending on the results of next week’s primaries.

“There’s going to be two kinds of Democrats in 2018: those who ran, and those who wish they did,” said Rep. Sean Maloney (D-N.Y.).

Republicans already were bracing for a rough year, with the president’s party traditionally losing seats in midterms and dozens of GOP incumbents retiring. The unpopular Trump poses an even tougher challenge for Republicans, as the election has become a referendum on the president.

Republicans had hoped — and will continue to try — to make the campaign about their tax cuts. But that argument failed to gain traction in the Pennsylvania race, drowned out in part by the White House chaos of firings, investigations and resignations.

The GOP tried to tie Lamb to House Minority Leader Nancy Pelosi (D-Calif.), the San Francisco liberal and subject of countless Republican attack ads over the past 10 years. Lamb said he would not support her for speaker if Democrats won the House, undercutting the GOP criticism.

Yet Republican groups still plastered the Pennsylvania airwaves with her image, highlighting polls that had her favorability in the district at 25 percent.

A day after the election, Republicans made clear they will be relentless in using Pelosi as a cudgel against Democratic candidates.

“It’s really important to also talk about what would happen if Nancy Pelosi became speaker again,” said Rep. Steve Scalise (R-La.), the party’s whip.

Pelosi took Lamb’s apparent victory as proof that the attacks no longer connected, dismissing questions about her popularity.

“He won. If he hadn’t won, you might have a question. But he won,” she said.

In interviews over the past month with 16 Democrats running for Congress, none said affirmatively that they would support Pelosi for speaker.

“They’ve already called me Pelosi’s boy,” said South Carolina’s Parnell. “They called me that in the special election. They called me that when I raised $ 340,000 in the first quarter. My response has been that I’m my own man, I think for myself, and things change. Things should change. People don’t hold positions forever.”

Lamb, a 33-year-old Marine veteran and former prosecutor, proved a winning formula for Democrats in a suburban and working-class slice of Pennsylvania. He offered more moderate views on guns and abortion while focusing on jobs, Social Security and health care.

Republican strategists argued that the party’s liberal base would not nominate many candidates like Lamb.

“Find me the Democratic primary in the United States of America that Conor Lamb can win,” said Corry Bliss, president of the Congressional Leadership Fund, a Republican PAC that spent more than $3 million in the race.

While universal Medicare, a $15 minimum wage and free college tuition have become liberal litmus-test issues, MoveOn, the Progressive Turnout Project and every major labor union had endorsed Lamb — who opposed all three of those proposals.

“We have Conor Lambs all over the heartland,” said Rep. Cheri Bustos (D-Ill.), who has recruited and trained Democratic candidates for races in the Midwest. “We have more than 60 candidates in our targeted districts who are veterans, national security experts, CIA operatives, businessmen and businesswomen, who fit their districts like a glove.”

Since 2016, when Trump won and the GOP kept control of the House and Senate, Democrats have flipped a net 39 state legislative seats from red to blue, swept statewide elections in Virginia and New Jersey, and elected Sen. Doug Jones (D-Ala.).

It was a better result than Democrats had imagined after Hillary Clinton’s loss to Trump. Maloney did an election autopsy, concluding in early 2017 that Democrats “can win where we used to struggle, and we’re struggling a bit where we used to win.”

The Pennsylvania result suggested that Democrats were beginning to overcome those trends.

“We never suggested for a minute that we needed to stop fighting for rural areas,” Maloney said. “What we saw was a surge in Republican support in rural areas and a move away from Republicans in the suburbs. What you’re seeing now, on top of that, is a surge in Democratic turnout. It’s a combination of dispirited Republicans and a highly energized Democratic base.”

Still, Democrats face the divide between liberals and moderates that could cost them seats in November. On Tuesday, conservative Rep. Daniel Lipinski (D-Ill.) hopes to turn back a primary challenge from liberal Marie Newman.

Democrats are nervously watching three districts in Southern California, carried by Clinton in 2016, especially two where Republican incumbents are retiring. The state’s top-two June primary sends the biggest vote-getters into November runoffs, even if both belong to the same party. In 2012, that led to Democrats fumbling away a safe seat.

Democrats winnowed out several weak candidates ahead of the filing deadline Wednesday, but not as many as they’d hoped. Democrats fear that too many of their candidates could splinter the vote, clearing a path for Republicans.

In Wisconsin’s 1st Congressional District, which House Speaker Paul D. Ryan (R) has represented since 1999, Democrats are encouraged by the steady fundraising of union organizer Randy Bryce, the first of several candidates this cycle to build a national donor network with viral videos.

Bryce said of Lamb: “He ran a pro-union campaign, and that’s what I’m running, too. It means talking about wages, you’re talking about pensions, and that resonates with working people.”

Not surprisingly, the chairman of the National Republican Congressional Committee has told GOP candidates that Pennsylvania was a “wake-up call.”

“They’ve got a few weeks to show in first-quarter numbers they’re taking this seriously,” Rep. Steve Stivers (R-Ohio) said in an interview. “You’ve got to tell your story, because if you don’t, your opponent will.”

Ed O’Keefe and Mike DeBonis contributed to this report.