A conventional candidate in an unconventional race, Mr. Kasich, 63, outlasted the other governors in the Republican field. But his longevity was largely a testament to his unbending refusal to drop out long after it became clear that voters were not flocking to his campaign.

He rarely wavered from his above-the-fray approach to his rivals, even as they racked up far more delegates. When they attacked one another, Mr. Kasich struck a sunny tone and told people that they were made special by the Lord. While Mr. Trump and Mr. Cruz emphasized their outsider status, he ran unapologetically as a candidate with experience.

Mr. Kasich, citing polls, had insisted that he was the only remaining Republican candidate who could win in November. But while he expressed hope that voters in the Northeast would embrace him, he was obliterated by Mr. Trump in the five states that held primaries last week, and he never matched Mr. Cruz as the main alternative to Mr. Trump.

In a last-ditch deal with Mr. Cruz, Mr. Kasich agreed not to compete in Indiana, a critical state for those hoping to stop Mr. Trump. Mr. Cruz, in exchange, agreed not to compete in two states with later contests, Oregon and New Mexico.

Mr. Kasich had hoped that neither opponent would win enough delegates to clinch the nomination before the Republican convention in July. In that case, many delegates could potentially vote as they wished, regardless of which candidate voters in their home states preferred. Mr. Kasich said he believed his track record in government and his favorable poll numbers in hypothetical matchups against the Democratic front-runner, Hillary Clinton, would win over those delegates.