With the midterm elections less than two weeks away, a growing number of Republican candidates across the United States are publicly distancing themselves from President Donald Trump amid concerns over his declining popularity and the party’s electoral prospects.

In Michigan and Iowa, Republican Senate nominees have urged an end to the ongoing conflict with Iran, linking the resolution of the war to a drop in rising gas prices. Former Representative Mike Rogers, campaigning in Michigan, emphasized the need to “end the war with Iran quickly” to bring down energy costs. Similar calls came from gubernatorial candidates in Wisconsin and Michigan, as well as an embattled Ohio Republican senator.

On Capitol Hill, a trio of Republican senators supported an investigation into the president’s son following revelations that a lavish after-party for his wedding was financed by a Russian businessman with ties to President Vladimir Putin. In Florida, Representative Byron Donalds, a close Trump ally and the state’s Republican nominee for governor, revised his campaign website to reduce the prominence of Mr. Trump’s endorsement.

These developments underscore internal tensions within the Republican Party as candidates worry about leveraging Mr. Trump’s endorsement in key races. His approval ratings have hit near-record lows, with his standing on traditionally strong issues such as the economy, national security, and immigration declining sharply. A recent CNN poll showed his approval on the economy at 27 percent. Republican strategist Nachama Soloveichik characterized the party’s shifting stance as strategic responses to unfavorable polling numbers.

The White House dismissed claims of growing distance between the president and the party, citing more than 60 Republican candidates who have publicly praised and appeared alongside Mr. Trump. “President Trump is the unequivocal leader, best messenger, and unmatched motivator for the Republican Party,” stated White House spokesman Davis Ingle.

Historical precedent shows vulnerable candidates often seek to separate themselves from unpopular, second-term presidents during midterms. In 2006, many Republicans distanced themselves from President George W. Bush amid Iraq War backlash. Democrat candidates in Republican-leaning states similarly criticized President Barack Obama in 2014.

The Republican Senate’s recent rejection of a Democratic-led war powers resolution demonstrated the party’s continued support for Mr. Trump’s policies, despite some public critiques. Marc Short, former White House legislative affairs director, described the current distancing as more pronounced and “somewhat like desperation,” highlighting the political calculus candidates face amid unpopular policies.

Democrats have seized on the discord, with House Minority Leader Hakeem Jeffries asserting that Republicans are “in full panic mode” over the president’s low approval ratings. Yet Mr. Trump and his allies remain focused on energizing his core base, exemplified by a high-profile rally in Dallas where the president urged supporters to vote as if he were on the ballot.

Nonetheless, some Republicans are consciously avoiding association with the president. Several vulnerable candidates skipped the Dallas event, signaling efforts to appeal to broader electorates. Campaign advertisements across swing states are increasingly framing Republican opponents as loyal to Mr. Trump, while some Republicans have shifted positions on key issues like the Iran war to reflect constituent concerns.

States like Iowa exemplify this trend, with Senators Chuck Grassley and Dan Sullivan advocating measures such as a temporary embargo on diesel exports to curb fuel costs, despite resistance from the administration’s energy secretary. In traditionally Republican strongholds like Florida and Texas, candidates balance distancing from Mr. Trump while maintaining appeal to his supporters.

In Florida, Representative Donalds’s campaign spokesman dismissed interpretations of his website changes as meaningful, asserting his campaign prioritizes local issues such as affordability and government transparency. Meanwhile, in Texas, extensive funding is being directed to Senate races featuring candidates with varying levels of association with the president.

The widening Republican fissures reflect the complex political landscape as the party navigates mounting challenges heading into the November midterms, weighing allegiance to Mr. Trump against electoral viability in competitive races.