John Kasich speaks as his wife, Karen, looks on during an election night rally in Berea, Ohio, on March 15, 2016. (David Maxwell/European Pressphoto Agency)

Gov. John Kasich won his home state’s winner-take-all primary on Tuesday, rescuing his campaign for the presidency and becoming the last Republican candidate acceptable to the party’s nerve-racked establishment.

“Tomorrow, I’m going to Philadelphia,” he said at a victory party at Baldwin Wallace University in Cleveland’s suburbs. “We’re going to go all the way to Cleveland and secure the Republican nomination.”

It was Kasich’s 24th consecutive win in Ohio politics; to ensure it, he stormed the state for five of the six days after his close third-place showing in Michigan. Kasich built a small lead in public polls, while reporters reminded him of his promise to “roll up the carpet” if he lost Ohio.

In the end, it was close but decisive. Kasich dominated Trump in the cities and suburbs of Cleveland, Columbus, and Cincinnati. Trump drew closer in areas where the economy had been slow to recover from the 2008 recession, and he defeated Kasich in the southeastern counties where manufacturing and coal jobs had been disappearing since the 1970s.

Kasich’s personal popularity in the state allowed him to overcome hurdles that had stopped him elsewhere. In exit polls, Kasich won 31 percent of the vote among “very conservative” Republicans, a group in which he had averaged just 5 percent support across all contests. More than half the Republican voters in Ohio said they would not support Trump in a general election, the highest of any March 15 state.

Kasich and Trump were both helped by Democrats who crossed into the Republican primary, some of them to stop the national front-runner and some to aid him. But Kasich ran strongest with those voters, winning 56 percent support to Trump’s 41 percent.

“He’s going to be very helpful to Donald,” said Jeff Roe, campaign manager for Sen. Ted Cruz (R-Tex.), a rival for the GOP presidential nomination, before Kasich’s Ohio victory was official. “He does not help us.”

In a campaign memo Tuesday night, Kasich strategist John Weaver pointed to internal data that found supporters of Sen. Marco Rubio (R-Fla.) would break to the Ohio governor by 3 to 1. “With the electoral map shifting significantly in our favor, Governor Kasich is positioned to accumulate a large share of the almost 1,000 remaining delegates,” he said.

Kasich, who trails Cruz in cash on hand, told The Washington Post this week that “the fundraising side of this thing” would improve after an Ohio win.

The Kasich crossover voters Tuesday night included people such as Scott Ross, 63, a retired businessman in Olmstead Township who decided only in the past week to back his governor.

“In any election, you want to have the most competent people running,” he explained. “He deserves a chance to get his message to the rest of the country. More people should hear it.”

In his victory speech, Kasich thanked crossover voters, crediting them with rejecting “socialism” in the Democratic Party.

“I want to thank them for coming over in this election and putting their confidence in me, because I think we all know that conservative principles can work, and common sense can work,” he said.

Before 2016, the idea of Democrats backing Kasich to save the Republican Party from its extreme would have been risible. A deeply conservative member of the House, Kasich briefly hosted a Fox News talk show, worked at Lehman Brothers, then returned to Ohio to win the governor’s mansion in the tea party wave.

But Kasich’s image since then, molded both by reality and his campaign team, had set him apart. Kasich is one of relatively few Republican governors to accept the Medicaid expansion of the Affordable Care Act, and he ended up besting rivals who did not — and Rubio, who worked in the Senate to repeal the law.

On the stump, and in his victory speech, Kasich spent more time talking about togetherness than doctrinaire conservatism. In his first moment of triumph of the primaries, he even joked along with a heckler who shouted Trump’s name.

“When you went to college in the 1970s, you appreciate a good protest,” Kasich said.

Kasich’s Wednesday morning trip to the Philadelphia suburbs is what his campaign expects to be the start of a run through the later and more moderate primaries, such as Pennsylvania’s, and in heretofore-ignored places such as Delaware, Connecticut and Wisconsin.

“I think the issue in Pennsylvania is going to be who can beat Hillary Clinton,” said former congressman Bob Walker, Kasich’s Pennsylvania chairman. “The numbers in this state are just phenomenal on that count. John has the ability to win in places like the Philadelphia suburbs, and in the western part of the state, where he’s from, and where Republicans are winning now.”

Some evidence for Kasich’s suburban strategy emerged in the night’s less-watched primaries in Illinois, Missouri and North Carolina. In the latter state, where Kasich did not really compete, he fared well in the suburbs of Charlotte. In early results from Illinois, Kasich ran second to Trump, and far ahead of Cruz in the greater Chicago counties of Cook, DuPage and Lake.

Such numbers, repeated in other states, would effectively end any candidate’s shot at coming to the Republican National Convention with the 1,237 delegates needed for a first-ballot nomination. In a campaign memo, Kasich’s campaign flatly stated that no campaign could achieve that number, thanks to the Ohio win.

“There’s going to be a contested convention, no question about that,” said former New Hampshire senator Gordon J. Humphrey, a Kasich endorser who moved to Michigan and then Ohio to campaign for him. “I don’t want to hear any talk about people getting scared and forming a third party. That would be fatal.”

Yet one reason Kasich avoided the fate of Rubio was that little money, or time, had been spent to tarnish his image. This week, in an interview with The Post, Kasich was reminded that Trump had never coined a nickname for him, along the lines of “Little Marco” Rubio or “Lyin’ Ted” Cruz.

“He calls me the governor,” Kasich said.

Philip Rucker, Dan Balz and Scott Clement contributed to this report.