“So they have to team up (collusion) in a two on one,” Mr. Trump wrote. “Shows weakness!”

At a campaign rally in Rhode Island, Mr. Trump boasted that his opponents were united against him, and said he welcomed their “collusion.”

“Actually I was happy,” he said, “because it shows how weak they are.”

Allies of both Mr. Cruz and Mr. Kasich did not exactly disagree with that assessment, and acknowledged that the prospect of imminent disaster in Indiana had been the impetus to reach their deal, such as it is.

Still, aides to Mr. Cruz and Mr. Kasich seem acutely aware that they risk turning off voters who find the arrangement unseemly. Even before his rivals’ agreement, Mr. Trump had complained repeatedly that the nominating process was “rigged” against him.

With Mr. Trump expected to win all five of the East Coast states that vote on Tuesday, the next opportunity to slow his campaign will come a week later in Indiana. Republicans believe he must be stopped there if they are to deny him the nomination.

“Indiana is a must-win for Ted Cruz, and it’s a must-win for anybody who doesn’t think Donald Trump should be the nominee,” said David McIntosh, the president of the Club for Growth, a conservative group opposed to Mr. Trump and supportive of Mr. Cruz. The group is airing an ad in Indiana urging voters to vote for Mr. Cruz, not Mr. Kasich, to stop Mr. Trump, and officials said they intended to keep it on the air despite the agreement.