With only hours left before Election Day, here’s the painful, self-evident truth facing lifelong Republicans like me: The 2016 presidential campaign has revealed dark and disturbing things about not only Donald J. Trump but also the party that nominated him.

Self-renewal starts — but doesn’t end — with self-examination.

The forces that propelled Mr. Trump’s rise need to be confronted and defeated. It won’t be easy, given that tens of millions of Americans will vote for him and believe deeply in him. But if these forces are not defeated, what happened this year will be replicated in one form or another, and the Republican Party will continue to inflict great harm on our republic.

If Mr. Trump loses the presidential race, as I believe is likely but hardly a sure thing, it will not be enough for Republicans to excuse or ignore his candidacy. It could never have happened unless things had gone terribly awry in the Republican Party. Its political and moral recovery requires Republicans to reverse three destructive trends that have emerged over the last decade.

Anti-intellectualism. As Margaret Thatcher once said, first you win the argument, then you win the vote. One of the appealing things to me about the Republican Party in the early 1980s, as a young conservative, was that it had become a party of ideas, of governing experiment. But somewhere along the way large numbers of Republicans began to devalue serious ideas. For example, as early as 2013, Gov. Chris Christie of New Jersey, one of Mr. Trump’s most emphatic supporters, said of his fellow Republicans, “I think we’ve had too many people who’ve become less interested in winning an election and more interested in winning an argument.”

Pointing to the precise moment this devaluation occurred is difficult; it was a gradual process. But the embodiment of what I’m talking about is someone like Sarah Palin, who started out as a relatively conventional, if unaccomplished, Republican governor and was thrust into the spotlight as John McCain’s vice-presidential nominee in 2008. Since then she has become the proud personification of thoughtlessness. I don’t agree with President Obama on very much, but he was right when he said there was a straight line that could be drawn from Ms. Palin to Mr. Trump. A party that produces Ms. Palin as its vice-presidential nominee and Mr. Trump as its nominee is at war with reason.

Political recklessness. Over the years a large number of Republicans began to dismiss the craft of governing. They embraced a style of politics characterized by unceasing combativeness, intemperance and a deep hostility toward compromise and temperamental moderation. One example: the 2013 shutdown of the government, a ridiculous and politically damaging move led by Senator Ted Cruz of Texas.

Particularly since the election of Barack Obama, we have witnessed on the Republican side the rise of fear, anger and apocalyptic rhetoric. It didn’t have to be this way, but we’ve also seen the growing appeal of conspiracy theories, with the most poisonous and revealing being that Mr. Obama was not born in the United States.

In 2011, I wrote a column in The Wall Street Journal criticizing Mr. Trump’s embrace of birtherism, warning that “when prominent figures in a party play footsie with peddlers of paranoia, the party suffers an erosion of credibility.” I also pointed out that “people are generally uneasy about political institutions that give a home to cranks.” But I never for a moment imagined that Mr. Trump, as the chief apostle of this crazed, racist conspiracy theory, would become the nominee of the Republican Party five years later. Yet he did, and he did it in large part not despite but because he has championed one conspiracy theory after another. When conspiracy theories gain wide currency within a political party, it means it is losing — or has lost — contact with reality.

Appealing to nativism and xenophobia. Within the Republican Party there are legitimate concerns about illegal immigration. While I favored comprehensive immigration reform in the past, I never believed that most of the opposition to it was based on nativism. (Even now, most Republicans favor a pathway to legal status and citizenship for illegal immigrants.) But what can’t be denied is that the Republican nominee began his campaign by appealing to nativism and xenophobia, and as the primaries unfolded it was the issue he returned to time and time again. Mr. Trump’s success has emboldened ugly forces within the Republican Party that had been confined to its fringes. Demonizing people of other races, cultures and faiths succeeded; demeaning women and war heroes succeeded. The fact that we’re now so familiar with his offenses shouldn’t inure us to how damning they are.

That a demagogue like Mr. Trump would emerge when there is a lot frustration in the lives of Americans who feel that their suffering is ignored isn’t without precedent. Which is why the greater sin of the Republican Party wasn’t that Mr. Trump won the nomination by carrying a plurality of votes in a large field. It was that people who surely knew better rallied to Mr. Trump once he became the nominee. Some advised him, others defended him and excused him, and still others tried to ignore him. Certain people acted worse than others. But in the end, they were all caught up in Mr. Trump’s ethical confusion and moral corruption. They didn’t pull him up; he pulled them down.

It is not as if the trends cited above were unknown to responsible Republicans and conservatives before the advent of Mr. Trump. They were, and some party loyalists challenged them at the time. Those efforts clearly failed, and Republicans have to come to terms with the fact that the rot was far more advanced than we understood.

Those of us who have long defended the Republican Party could do worse than honestly assess what role we might have played in all this, what we missed and why, and what more we could have done to stop it. When you are part of a political movement that chose Donald Trump as your nominee, some serious self-reflection is in order.

For now, though, the Republican Party faces a crisis. If Mr. Trump loses, the party faces a daunting reconstruction challenge. Policies that promote economic growth, social mobility and greater opportunity are important. But in some respects the party’s stance on the tax code, wage subsidies, higher education, tax credits or entitlement programs are a secondary priority.

Republicans need to wrestle with more fundamental questions first: Will their party choose as its leaders people who respect democratic institutions and traditions, or not; who conceive of America as a welcoming society or as one that is racially and religiously closed; who are committed to helping or exploiting the weak and vulnerable; who admire or oppose tyrants; who respect truth or view it in purely utilitarian ways; who abhor ignorance or embrace it? Will Republicans gravitate toward leaders who have authoritarian tendencies, who incite violence in their followers, and whose personalities are vindictive, cruel and disordered?

In a post-Trump world, Republicans need to ask themselves if their party will be characterized by its aspirations or its resentments. Can it make its own inner peace with living in an increasingly diverse and nonwhite America? Does it conceive of its role as tamping down or inflaming ugly passions? Does it believe in a just social order or not?

These questions are not about whether the economic concerns of Mr. Trump’s core constituency should be taken seriously and addressed by Republican policy makers. They clearly should, and in fact many of the people who urged the party to focus on this long before Mr. Trump entered the race are his most scathing critics. These questions go to how the Republican Party conceives of itself, its role and purpose in our political system and our common life. No single person can answer them. This self-definition rests with Republicans in every state and social stratum.

The next few months will tell us a lot about whether Mr. Trump and Trumpism were an anomaly or are now the new norm of the party that Lincoln helped create. Even liberal critics of the Republican Party who believe Mr. Trump was an inevitable result of the party’s political machinations have to concede he is in a different category than the nominees who preceded him. President Obama and Hillary Clinton have both said as much.

If Mr. Trump should win on Nov. 8, the Republican Party will be fundamentally redefined, to put it mildly. Many of us could not continue to be a part of a political institution defined by Donald Trump, by Breitbart.com and Ann Coulter, one that most resembles the right-wing nationalist parties we see in Europe. Our allegiance isn’t to a party; it is to a set of ideas and ideals, to the good of the whole, to what the prophet Jeremiah called “the welfare of the city.” No party is simply the embodiment of ideas, of course. All parties are coalitions. But a party that is recast into the image of Mr. Trump is something many of us would want nothing to do with.

Of course, if Mr. Trump wins, it won’t simply be the Republican Party that faces its moment of reckoning. Our republic will, too. That worries me a great deal more, because I love my country far more than I love my party.

Peter Wehner, a senior fellow at the Ethics and Public Policy Center, served in the last three Republican administrations and is a contributing opinion writer.