WASHINGTON (MarketWatch) — An unprecedentedly bizarre presidential campaign turned even more so over the past week as Republican nominee Donald Trump was labeled “crazy” in headlines and media speculated openly how the party could replace him at the top of the ticket.

The dozen indications for narcissistic personality disorder listed by the American Psychiatric Association got a lot of attention because they were all — all — disturbingly apt descriptions of the behavior Trump has shown over the past year.

His obsessive feud with the parents of a Muslim soldier killed in Iraq over remarks they made about him at the Democratic convention seemed self-destructive as it cast Trump in a very bad light and kept him from exploiting a stream of negative news about his Democratic rival, Hillary Clinton.

It allowed President Barack Obama to claim more forcefully than ever that the Republican nominee is unfit for office and “he keeps on proving it.”

Even conceding that a certain amount of Democratic disinformation and media bias crept into the coverage of all this, it was a harrowing near-meltdown that is likely to leave a permanent mark on Trump’s campaign.

Trump Calls Clinton the 'Founder of ISIS'

The situation calmed by Wednesday as Trump dropped the feud with the Khan family and appeared to get “back on message.”

But the public got a glimpse of out-of-control behavior, compared by many to a runaway train, which will be hard to un-see.

Republicans have their own reasons for wanting to keep Trump on board. Down-ballot candidates need the votes of Trump supporters to maintain Republican majorities in the Senate and House of Representatives, so they can’t afford to alienate them by repudiating the nominee.

But Democrats, too, have a vested interest in keeping Trump in the race as they field their own deeply flawed and unpopular candidate for the White House.

Trump sympathizers have charged that Khizr and Ghazala Khan were put on the Democratic convention agenda to talk about their fallen son, Humayun, precisely to bait Trump into the kind of reaction that was not long in coming.

Whether it was a tactic or not, the ensuing fracas went almost too far as it opened the door to speculation about actually replacing Trump on the ticket.

In the current rules of the Republican National Committee, Rule No. 9 specifies that the 168 committee members can name a replacement if any vacancies occur on the national ticket “by reason of death, declination, or otherwise.”

The three committee members from each state would cast the same number of votes the state would have in a full convention, and the same simple majority would be required for the new nominee.

However unfit they want to show Trump to be, replacing him is not something Democrats want to achieve.

Imagine for a moment that Trump gets fed up with the whole thing, or his family intervenes to save him from further embarrassment — both seem unlikely at the moment but it is a volatile race — and the RNC coalesces around, say, House Speaker Paul Ryan as the new presidential nominee.

Ryan would no doubt be happy to keep his good friend Mike Pence as running mate and a Ryan-Pence ticket could pose a much more formidable challenge to Hillary Clinton and Tim Kaine.

Far better to keep Trump in the race, sucking up all the media oxygen with one controversy after another. This keeps the media spotlight away from Clinton, and eases the political pressure on her for her own transgressions.

After all, how hard will any investigative team of journalists dig into the murky dealings of the Clinton Foundation if undermining the Democratic candidate would help boost Trump into office?

Trump has bragged that he can play the game any way that is required, and will appear exceptionally presidential when he wants to.

Perhaps that is true, and Trump in the coming weeks will appear more reasonable and close the gap in the polls that has opened up between him and Clinton. Or perhaps Trump will turn in a brilliant performance in the presidential debates and regain ground that way.

But it will be difficult for any but his hardcore supporters to forget the pettiness, the vindictiveness and the sheer lack of discipline on display from the candidate in the past week, removing any benefit of the doubt about his character that may have survived the preceding months.

If the Democrats can continue to discredit Trump without actually pushing him out, it will be more than ever Clinton’s race to lose.