Conventional wisdom holds that the Republican Party suffered a big political penalty for impeaching Bill Clinton in 1998. But that’s not quite right. Republicans paid a modest, short-term penalty, while the costs to the Democratic Party appear to have been larger and longer-lasting.

This history has obvious relevance today. As in the 1990s, the economy is growing, yet many Americans are uncomfortable with the president’s behavior. And although the actions of Clinton and President Donald Trump are far from equivalent, there are similarities: Both men acted inappropriately (being dishonest under oath about an Oval Office affair with a 22-year-old subordinate; seeking foreign interference to benefit a reelection campaign), and most Americans disapprove of both forms of misbehavior.

Two decades ago, the Republicans’ decision to impeach Clinton focused the country’s attention on his behavior rather than on the economy or their own unpopular policies. The same dynamic could easily repeat itself in the coming months: Talking about Trump and Ukraine is certainly better for Democrats than talking about a ban on private health insurance.

Since House Democrats announced their impeachment inquiry three weeks ago, there has been a lot of hand-wringing about the potential downsides. But Democrats should move forward with confidence. They are doing the right thing on principle — as well as following the path that has the best chance of political success.

It’s worth taking a few minutes to look back at the Clinton case. House Republicans began impeachment proceedings in October 1998, a few weeks before midterm elections. Republicans expected to make major gains in those midterms, thanks partly to the scandal, and failed to do so. In response, Newt Gingrich, the speaker of the House, resigned, and the conventional wisdom was born.

But talk of impeachment probably wasn’t the main reason for the Republican disappointment. The economy was booming, and polls throughout 1998 showed a tight race, not a wave, as Kyle Kondik of the University of Virginia has noted. On Election Day, Republicans did perfectly fine. They won the national popular vote and kept House control. Their Senate majority was unchanged.

Afterward, at the insistence of Tom DeLay, a Republican leader, the House impeached Clinton. Doing so ensured that the affair and his efforts to cover it up — like the angry “I did not have sexual relations with that woman, Miss Lewinsky” line that he delivered with Al Gore by his side — dominated the news for months.

While the Senate acquitted Clinton, impeachment became its own stain on him, much worse than the vague “censure” many Democrats preferred. He was only the third president to endure an impeachment inquiry, ignominiously joining Andrew Johnson and Richard Nixon. Impeachment, as schoolchildren learn, is what happens when a president behaves very badly.

Americans continued to approve of Clinton’s job performance, polls showed, but many also said they disapproved of him personally. The discomfort helped define the 2000 presidential race, in the views of both Gore’s campaign and George W. Bush’s.

Bush made it his mantra to “restore honor and dignity” to the White House. Gore chose Joe Lieberman, arguably Clinton’s highest-profile Democratic critic, as a running mate. “Everybody who said the economy was so good, you should just run on Clinton’s record — they weren’t sitting in focus groups in swing states, listening to these swing voters who were concerned there would be a continuation” of unethical behavior, Tad Devine, a Gore adviser, recently said to The Atlantic’s Ron Brownstein.

Shortly after the election, Thomas E. Mann of the Brookings Institution wrote: “Most Americans were appalled by his behavior; he never regained the personal standing he enjoyed before the scandal.” Had Clinton campaigned heavily in the 2000 race, Mann added, “The evidence was overwhelming that he would have done more harm than good with swing voters in battleground states.”

True, Gore was a flawed candidate, and a stronger one may well have overcome the scandal. But it did make his job harder. He lost a large share of voters who approved of Clinton’s performance but disapproved of Clinton personally, as Democratic pollster Stan Greenberg told me. And loyal Republican voters, frustrated by Clinton’s acquittal, turned out in big numbers, Matthew Dowd, a top Bush adviser, has said. In the end, Gore won the popular vote only narrowly, despite the strongest economy in decades, and lost the election.

Over the next eight years, Republicans continued to hold the White House and usually controlled Congress. Only Bush’s unpopular presidency — Hurricane Katrina, the Iraq War, the financial crisis — delivered control back to the Democrats. It’s impossible to know how things would have played out if Republicans had skipped impeaching Clinton, of course, but there is little sign they paid much of a price, if any, for doing so.

Today, every argument for impeachment is stronger than in 1998. On the politics, a greater share of Americans already support impeachment than ever did in 1998, while Trump’s approval rating is a meager 42%. On the substance, I think that Clinton’s behavior was in a gray area of “high crimes and misdemeanors”: odious, illegal but largely personal. Trump’s behavior is spectacularly impeachable, involving one of the founders’ central justifications: foreign interference.

Trump deserves to be impeached on the merits, and, if he is, it will probably further sully him in the eyes of swing voters, much as it did to Clinton. The big question now is how well will Democrats handle the process. They should move quickly to hold more public hearings, rather than the private sessions they held last week, so Americans can better understand how Trump has perverted American foreign policy and national security for his own benefit.

Ultimately, impeachment may well hurt some Democrats from Trump-friendly districts, much as it hurt several Republicans 20 years ago. But it is also very likely to damage Trump — as his own sullen reaction suggests that he realizes. That’s a trade-off worth making.

David Leonhardt

David Leonhardt is an Op-Ed columnist for The New York Times.