Across the country, Republicans in contested races face a terrible bind: They have to run from Donald Trump to hold onto swing votes, even if that angers some core supporters.
But in secure, heavily conservative GOP districts, Republicans face the opposite pressure: to cleave fast to Trump, who remains popular despite statements that have alienated many voters.
The crisis sparked by the Trump campaign has split the Republican Party in two, and ironically, the gerrymandering of districts that helped build the GOP congressional majority is now working to make that fracture worse.
The division of interests between Republicans who represent solidly conservative districts and those who represent swing areas — or senators who must run statewide — has seldom been more stark.
"The Republican Party has drawn itself into an ideological cul-de-sac that bears no resemblance to the larger electorate," said David Wasserman, House editor at the nonpartisan Cook Political Report. "The middle has shrunk dramatically."
Their battlefield was once confined mostly to Capitol Hill, crippling the Republican legislative agenda, fueling the tea party movement and leading to a government shutdown.
Now it is upending the presidential race. Trump's anti-establishment message has unleashed a conservative grass-roots movement inside the Republican Party that leaders are finding they cannot control.
And as Trump's nationwide support begins to slip amid his unconventional behavior and offensive remarks about women and minorities, Republicans risk not only missing their shot at the White House, but losing control of the Senate and handing Democrats an opportunity to shift the Supreme Court to the left.
The GOP infighting, in many ways, is no surprise and largely of the party's own making.
A gerrymandering of congressional districts, completed six years ago, sought to secure a Republican House majority for years to come by packing Democratic voters into fewer, often urban and minority districts and giving Republican candidates comfortable majorities in the ones they control.
But those tailor-made districts yielded a new crop of hard-right, often uncompromising Republican members of Congress, running safely in mostly white, older and rural districts, where Trump's support is strongest.
These conservative House members are increasingly at odds with Republican senators, party leadership and a handful of remaining House swing-district lawmakers, who are wringing their hands over Trump because they still must appeal to a broader swath of voters, including moderates, independents and minorities.
Trump's candidacy is the latest and perhaps most consequential issue forcing Republicans to pick sides.
Even as House Speaker Paul D. Ryan (R-Wis.) announced Monday he wouldn't campaign for the GOP presidential nominee, two Republican congressmen backing Trump joined the candidate at a boisterous rally in Wilkes Barre in northeastern Pennsylvania.
Trump raised the stakes further on Tuesday by openly attacking Ryan in a tweet as a "weak and ineffective leader" who is losing support of party members because of his "disloyalty."
Trump's strongest supporters in Congress include some of those from the most partisan-carved states, including Rep. Mark Meadows of North Carolina, who stumped for Trump at the GOP convention in Cleveland when other lawmakers stayed away; those in the South and Midwest; and several newer Republicans from upstate and rural New York.
Those who pull away from Trump face a backlash, as happened over the weekend in Nevada, when Joe Heck, the congressman running for Senate, was heckled as he called on Trump to drop out.
A recent NBC News/Wall Street Journal poll found about two-thirds of Republicans, 67%, think GOP congressional candidates should stand by Trump, despite his comments and actions.
Senators don't have the luxury of tailor-made districts as they run for office statewide, which is why so many more of them have abandoned Trump.
Sens. John McCain in Arizona and Rob Portman in Ohio, who have their own brands to preserve as they run for reelection, are distancing themselves from the top of the ticket.
Among those who dropped Trump after the disclosure of his sexually aggressive comments about groping women were many senators running for reelection in battleground states — Kelly Ayotte in New Hampshire, for example — and the few House Republicans in the remaining competitive districts, such as Rep. Mike Coffman in Colorado and Rep. Barbara Comstock in Virginia. Some like Rep. Carlos Curbelo in Florida were never on board.
Several female lawmakers, including Rep. Martha Roby of Alabama and most of the Republican women in the Senate, dumped Trump, even if they did not face a direct election challenge.
"Trump's video seems to have been a bridge too far for many female lawmakers, compelling them to break with their fellow partisans," wrote Sarah Binder, a political science professor at George Washington University and a senior fellow at the Brookings Institution.
There were a outliers, to be sure. Senate Majority Leader Mitch McConnell still supports Trump, in a nod to party decorum. Some senators in tough reelection battles, including Marco Rubio in Florida and Roy Blunt in Missouri, are keeping to a narrow position — critical of Trump's behavior, but not dropping their support for him as the nominee.
It's rare to see a national political party come to this, but it isn't hard to see how it happened. Early warning signs that the party was in trouble emerged as soon as Republicans won control of the House in 2010.
Initially, the Republican sweep of that year's House midterm election looked like a reaction to President Obama's agenda as voters rejected his economic stimulus and tried to stop the new healthcare law.
However, the outcome was by design. Republican-controlled statehouses had redrawn congressional districts to give the GOP all-but guaranteed seats, which by 2014 swelled the House majority to 247, the largest since President Herbert Hoover won the White House.
The takeover of the Senate four years later sealed the GOP majority in Congress.
Outside groups poured in campaign cash to shore up the dynamic, and the number of competitive districts dwindled to historic lows. Just 10% of the 435 House seats are seen as up for grabs this fall.
But the hardened lines also meant GOP lawmakers were left with little room to stray from partisan orthodoxy lest they face a primary challenge from a more conservative candidate. That's what happened to former Majority Leader Eric Cantor, ousted in a stunning 2014 upset by a tea party challenger.
Led first by the tea party and later the Freedom Caucus, the new partisan warriors fueled the showdowns and shutdowns, and ultimately chased former Speaker John A. Boehner into early retirement.
Many of them launched the Trump caucus in the House, now counting about two dozen members.