For months, Senate Republicans have been working with Democrats on a deal they have described as a once-in-a-generation opportunity for a conservative border security bill, and for weeks, they have hinted that they are tantalizingly close to an agreement.

Their timing could not be worse.

As former President Donald J. Trump moves closer to becoming his party’s presidential nominee and Republican lawmakers consolidate behind him, he is wielding a heavier hand than any time since leaving office over his party’s agenda in Congress. His vocal opposition to the emerging border compromise has all but killed the measure’s chances in a divided Congress as he puts his own hard-line immigration policies once again at the center of his presidential campaign.

His shadow has always loomed large over the Republican-controlled House, which has opened congressional investigations to defend him, launched an impeachment inquiry into his chief rival and approved legislation to reinstate the hard-line immigration policies he imposed. But as Mr. Trump barrels toward the party’s 2024 nomination, his influence on the legislative agenda on Capitol Hill is expanding.

His “America First” approach to foreign policy already helped to sap G.O.P. support for sending aid to Ukraine for its war against Russian aggression, placing the fate of that money in doubt. That led Republicans to demand a border crackdown in exchange for any further funding for Kyiv, a compromise that Mr. Trump has now repudiated. He frequently consults with the inexperienced Speaker Mike Johnson, weighing in on policy and politics. And his uncompromising approach has emboldened copycat politicians in Congress, like Representatives Marjorie Taylor Greene of Georgia and Matt Gaetz of Florida, who are helping to drive an ongoing impasse over government spending.

For a Congress that has struggled for more than a year to do the bare minimum of legislating, Mr. Trump’s dominance among Republicans is yet another drag on the institution’s ability to function in an election year when his name is likely to be on the ballot.

Mr. Trump burst onto the national political scene in 2015 with a dark warning about dangerous immigrants invading the country’s southern border and one slogan that outlasted them all in “Build the Wall.” More than eight years later, he is agitating against compromise and saying he wants no action taken on the border “unless we get EVERYTHING needed to shut down the INVASION.”

With more than half of Senate Republicans now officially backing Mr. Trump’s bid for president, those entreaties are becoming harder to ignore as prattle from Palm Beach.

On Wednesday, Senator Mitch McConnell of Kentucky, the minority leader and a champion of the emerging bipartisan border deal, acknowledged as much. He told Republicans privately that Mr. Trump’s growing influence has complicated the politics of the border, dividing Republicans against one another on an issue that once united the party.

Republicans are “in a quandary,” Mr. McConnell said in a closed-door meeting on Wednesday, according to lawmakers who attended. What was supposed to be the sweetener for conservatives opposed to sending tens of billions of dollars to Ukraine had become just as politically treacherous terrain as the foreign aid, itself, he acknowledged. Mr. McConnell, himself, regards the border deal as less important than sending military aid to Ukraine.

On Thursday, after members grew alarmed that Mr. McConnell’s message signaled the death knell for any potential deal, he clarified in a second meeting that he was still moving ahead with the border-Ukraine package. Still, the road is less certain than it was last year, before Mr. Trump began winning nominating contests.

Senators have been working on a border deal since just before Thanksgiving. But as the complicated talks have dragged on, Mr. Trump has begun collecting delegates and pressing for the party to coalesce around him and his agenda. His allies in Congress are clamoring for their colleagues to treat him like the party’s de facto leader and fall in line with his policies.

Mr. Trump and House Republicans want more severe immigration measures that stand no chance of passing the Democratic-controlled Senate or being signed by President Biden. Those include an end to grants of parole that allow migrants to live and work temporarily in the United States without visas while they await the outcome of their immigration claims, and a revival of the “Remain in Mexico” policy, which blocked their entry and forced them to wait elsewhere.

Mr. Trump’s influence over the agenda in Congress has sometimes been overblown, but he has always had far more power to derail things than to help lawmakers find consensus. He was unable to help his chosen candidate for speaker, Representative Jim Jordan of Ohio, get over the finish line in October, after Kevin McCarthy was ousted from the post, for example. But he had the ability to tank the bid of a lawmaker he opposed, Representative Tom Emmer of Minnesota, with one derisive social media post.

Mr. McCarthy worked hard last year to keep Mr. Trump quiet as he negotiated with Mr. Biden over a deal to avoid a federal debt default, aware that Mr. Trump had the power to drag away some critical Republican votes if he railed against it. Mr. McCarthy was able to pass it with a majority of the G.O.P. in support, in part because Mr. Trump waited until it was signed to criticize it.

But Mr. Trump was not yet winning nominating contests then, and spending cuts have never been the animating issue of his political identity.

Attacking Mr. Biden’s handling of the border is already a main plank of Mr. Trump’s campaign. He has accused Mr. Biden of instituting “open border” policies that allow terrorists and fentanyl to pour into the country, while vowing to build “even more wall” along the southern border. A Trump campaign ad claims that Mr. Biden’s immigration policies raise “the possibility of a Hamas attack” in the United States.

It is not clear yet whether Mr. Trump’s political agenda will derail other opportunities for bipartisan lawmaking this year on Capitol Hill, the prospects for which were already bleak given the electoral calendar and the dysfunction of the current Congress. Conservatives have already begun agitating against a bipartisan tax bill, whose passage could be construed as a victory for Mr. Biden since it would expand the child tax credit. Mr. Trump has yet to weigh in.

On Thursday, Republican supporters of the border deal were livid at the notion that Mr. Trump could potentially tank their painstakingly negotiated deal from the campaign trail.

“I think we have to have people here who here who support Trump, who have endorsed President Trump, go to him and tell him what a compelling case this is for someone who is likely to be our next president of the United States,” said Senator Thom Tillis, Republican of North Carolina. “Don’t pretend that the policy isn’t strong. If you want to admit you’re just afraid to tell President Trump the truth, that’s fine.”

Mr. Tillis said that to condemn the Senate proposal as too weak meant that “either you aren’t paying attention or you aren’t telling the truth.”

Senator Mike Rounds, Republican of South Dakota, said that Mr. Biden had a clear political problem on his hands at the southern border and “the politics would suggest that you allow him to boil in his own oil on this particular subject matter.”

He said the Senate still had an obligation to pass legislation to strengthen the country’s border, even if doing so would give Mr. Biden a political win. That does not appear to be the position most of his colleagues are taking.

Senator Christopher S. Murphy, the Connecticut Democrat who has been playing a lead role in the negotiations, said Mr. Trump’s opposition to the deal should come as no surprise.

“That is the cold, hard reality of Donald Trump, who just sees the border as a political issue, not as a policy problem to solve,” Mr. Murphy said.

Some hard-right Senate Republicans who are deeply opposed to the emerging deal accused Mr. McConnell of trying to pin its demise on Mr. Trump. Senator Ron Johnson, Republican of Wisconsin, said Mr. McConnell was “trying to shift blame to President Trump for what I would say are his failed negotiations.”

Senator J.D. Vance, Republican of Ohio, said it was shortsighted to send a “weak sauce” border security bill to the House, where Speaker Johnson has suggested it would be dead on arrival. That strategy Mr. Vance said, “allows the president to blame ‘MAGA’ Republicans for the failure of a border security package when it reality, what failed was a very weak border security package that didn’t actually do anything.”

Karoun Demirjian and Carl Hulse contributed reporting.

Leave a Reply

Your email address will not be published. Required fields are marked *