President Trump swept into Ohio the weekend before the special election, and in a tweet, he sought to take credit for Republican nominee Troy Balderson’s apparent victory. (Carolyn Kaster/AP)

President Trump taunted Ohio Gov. John Kasich on Monday, asserting that his increasingly vocal Republican rival is “very unpopular” and a “failed presidential candidate,” and to blame for the narrow margin in last week’s special congressional election in the state.

Kasich responded with an impish tweet: an image of Russian President Vladi­mir Putin breaking into a grin and laughing.

The salvos were the latest in the feud between Trump and Kasich, who is considering challenging Trump in the 2020 presidential race and has become one of the president’s sharpest GOP critics.

Trump’s attack, while demeaning, gave Kasich something his allies say he needs: a burst of national attention as he mulls whether to take on Trump and seek the party’s presidential nomination.

“It elevates Kasich,” said Bill Kristol, a conservative commentator and anti-Trump organizer. “What helps Trump the most is the idea that 85 percent of Republicans support him, so how could anyone run against him? The exchange with Kasich gets at Trump’s problems with general-election voters.”

Kristol added, “After the midterm elections in November, the whole party is going to ask whether it makes sense, politically, to stick with Trump. Trump knows that moment is coming, and so does Kasich.”

Kasich has been busy making the case that Republicans should be wary of following Trump’s lead. He told NBC’s “Meet the Press” on Sunday that the Aug. 7 election in Ohio’s heavily Republican 12th Congressional District was a reaction to the “chaos” he says voters see in Trump’s Washington, from the president’s conduct to Trump’s hard-line stances on trade and immigration.

“What you had is, I think, a message from the voters to the Republicans that you’ve got to stop the chaos and you’ve got to get more in tune and stop alienating people,” Kasich said. “It wasn’t a good night.”

Troy Balderson, the Republican nominee in the central Ohio district, remains neck-and-neck with Democrat Danny O’Connor in the race, which has not yet been called nearly a week after voters went to the polls. Regardless of who wins the election, the two candidates will square off again in November.

Trump swept into Ohio the weekend before the special election for a rally, and in a tweet last week, he moved to take credit for Balderson’s tally at the time, which showed him slightly ahead of O’Connor.

Still, many GOP strategists viewed the results in Ohio and in several primaries nationally last week as a dark omen three months before Election Day, saying they illustrate the limits of Trump’s ability to lift his party, particularly in suburban areas where the president’s popularity has suffered.

Trump, however, singled out Kasich on Monday as the reason for Balderson’s underwhelming showing, arguing without evidence that Kasich’s concerns about Balderson’s embrace of Trump — Balderson spoke alongside Trump at the closing rally — affected Republican turnout.

“The very unpopular Governor of Ohio (and failed presidential candidate) @JohnKasich hurt Troy Balderson’s recent win by tamping down enthusiasm for an otherwise great candidate,” Trump tweeted. “Even Kasich’s Lt. Governor lost Gov. race because of his unpopularity. Credit to Troy on the BIG WIN!”

Ohio’s lieutenant governor, Mary Taylor, lost her race for Ohio’s Republican gubernatorial nomination in May.

A Quinnipiac poll in June showed Kasich far outpacing Trump in terms of approval among Ohio voters. Fifty-two percent of registered Ohio voters approve of the job Kasich is doing as governor, while 43 percent approve of Trump’s performance as president.

Kasich’s top advisers welcomed the president’s scorn as a sign that Trump is keeping close watch on the threats he may eventually confront in his own party.

“They had been pretty disciplined about not attacking Kasich for the last two years or so,” Kasich strategist John Weaver said in an interview, referring to the Trump White House. “But the president is watching TV, and he’s not just watching Fox, and he’s hearing the footsteps behind him.”

Trump’s tweet Monday also reflects his eagerness to deflect blame for Republicans’ lackluster showing in the special election regardless of whether he perceives Kasich as a legitimate threat or just another critic to be rebuked for speaking out against him.

Kasich, 66, sought the 2016 Republican presidential nomination yet struggled to loosen Trump’s grip on the party’s base voters and never mounted a formidable challenge. At political stops since then, Kasich has regularly cast himself as a pragmatic and compassionate politician who holds hawkish views on foreign policy. Kasich has plans to return to New Hampshire, which holds the first presidential primary, in November.

During his years in the U.S. House, Kasich was known as a budget-cutting conservative, but he has since developed a more moderate persona due to his criticism of Trump and his decision to accept the expansion of Medicaid in Ohio as part of President Obama’s health-care law.

Unlike a crowd of prominent Republicans who were critical of Trump in the final weeks of the 2016 race, such as House Speaker Paul D. Ryan (R-Wis.) and former GOP presidential nominee Mitt Romney, Kasich has remained critical and frequently called out Trump and the president’s agenda.

“It’s been pretty lonely out here,” Kasich told The Guardian in July. “Most of the people have been upset with [Trump], and then endorse him and then they get upset with him. I just have not operated that way.”

Several modern Republican presidents have faced primary battles of varying degrees of seriousness. Incumbent Gerald Ford was challenged by Ronald Reagan in 1976, and George H.W. Bush was challenged by conservative leader Patrick Buchanan in 1992. Both Ford and Bush went on to fend off those challenges but were defeated in the general election after being hobbled.

Some historians are skeptical of a potential Kasich campaign, framing a challenge from the center as far more difficult than running against a president from the right.

“Reagan had deep roots in the conservative movement long before 1976,” said conservative author Craig Shirley, who has written extensively about Reagan’s run against Ford. Citing Reagan’s national radio commentaries in the 1970s and his relationships throughout the GOP’s activist wing, Shirley said “Kasich is not Reagan and has no such national following and no signature issue.”

Kasich was coy on Sunday when asked about a 2020 run.

“Maybe I will. Maybe I won’t. I don’t know,” he said.

Weaver, who served as Kasich’s strategist during the 2016 race, said the governor’s retort on Monday — a wry graphic of Putin on Twitter — was a message meant for the president.

“We’re not going to be trifled with,” Weaver said. “We’re going to bring a machete to a knife fight.”

White House officials dismissed Weaver’s remark.

“He’s cursing the darkness,” said one senior administration official, who was not authorized to speak publicly. “Who’s showing up to that fight? No one.”

Felicia Sonmez and Emily Guskin contributed to this report.