Editor's note: This column originally appeared in The Washington Post.

President Trump’s advisers apparently pleaded with him not to attack Sen. Jeff Flake (R-Ariz) at his rally in Arizona on Tuesday night. “They all said, ‘Mr. President, your speech was so good last night, please, please Mr. President, don’t mention any names,’ ” Trump noted. But he could not resist. After taking a veiled shot at Sen. John McCain (R-Ariz.), Trump declared,“Nobody wants me to talk about your other senator who’s weak on borders, weak on crime. So I won’t mention any names.” Just a few days earlier, Trump had tweeted an endorsement of Flake’s GOP primary opponent, declaring “Great to see that Dr. Kelli Ward is running against Flake Jeff Flake, who is WEAK on borders, crime and a non-factor in Senate. He’s toxic!” And the Mercer family — major Trump donors — have given $300,000 to a super PAC backing Ward in her efforts to unseat Flake.

All of which raises a question: Does Trump really want to make Charles E. Schumer the Senate majority leader? Why would a Republican president attack one of his party’s most vulnerable incumbents at time when the GOP holds such a narrow majority that it cannot pass legislation to repeal and replace ObamaCare — or much of anything else for that matter?

Yes, Flake failed to endorse Trump in 2016. And yes, Flake just wrote a book critical of Trump. So what? Flake has voted with the president 93.5 percent of the time — more often than Sen. Luther Strange, whom Trump just endorsed in the GOP primary in Alabama. Why on Earth would Trump risk replacing an annoying but reliable yes vote with a Democrat who would strengthen the “Resistance”?

If Flake loses the primary to Ward, Democrats could very well win the seat. Ward is a proven loser who was trounced in her foolhardy primary challenge against McCain in 2016. She recently exposed her political tin ear by calling on McCain to resign right after he was diagnosed with brain cancer — even suggesting that she be appointed as McCain’s replacement. She held town hall meetings to discuss “Chemtrails” — a conspiracy theory which holds that aircraft are deliberately spraying us with mysterious chemical substances. Ward is the 2018 version of Sharron Angle, the disastrous tea party candidate who cost the Republicans a winnable Senate race in Nevada in 2010 and gave us six more years of Harry Reid. Ward could hand Democrats a Senate seat in Arizona for the first time since 1988. And even if Flake holds her off, a costly and unnecessary primary race could weaken him in the general election, while draining resources Republicans should be using to target vulnerable Senate Democrats and expand the GOP’s Senate majority.

Flake is not the only endangered Republican to find himself in Trump’s crosshairs. This year, Trump went after Sen. Dean Heller (R-Nev.) for refusing to support the early, deeply flawed version of the Senate Republicans’ Obamacare replacement. A pro-Trump group launched an ad campaign against Heller — reportedly with the blessing of the Trump White House — and sent out tweets asking, “Why did @SenDeanHeller lie to voters about #RepealAndReplace? He’s now with @NancyPelosi. NOT GOOD!” A recent poll showed Heller narrowly trailing his likely Democratic opponent 41 percent to 42 percent, in a purple state where Hillary Clinton beat Trump 48 percent to 46 percent.

It is not in Trump’s interests to see either Heller or Flake lose in 2018. One lesson that Trump should have learned by now is that he needs more than 52 Republicans in the Senate to get 50 votes on his priorities. He needs to build his majority, not reduce it.

Republicans have a structural advantage in 2018, defending just eight Senate seats, while Democrats must defend 25 — including five in states that Trump won by double digits. But the party that controls the White House usually loses seats in off-year elections. And the GOP will enter 2018 with its base dispirited by legislative failures, while the anti-Trump Democratic base is energized and eager to deliver a stinging rebuke to the president.

If Flake and Heller lose, it is not outside the realm of possibility that Democrats could win back control of the Senate, making the Trump agenda dead on arrival in the chamber. Trump may not care about that, but there is something he should care about: If Democrats retake the Senate, they will control the Senate’s investigative committees. Does Trump want to hand Schumer unbridled subpoena power?

If so, then by all means he should do everything in his power to weaken Flake and Heller.