The popular claim that America’s exploding national debt doesn’t matter has many disturbing past parallels. Again and again, leading societies have convinced themselves that “this time is different,” only to repeat the fate of previous profligate states.

History teaches that high spending on politically favored priorities and rising debt have consistently undermined growth through crowding out private-sector investment, crowding out public-sector investment in longer-term priorities, and sparking financial crises as investors come to doubt the government’s creditworthiness.

Highly indebted countries have generally experienced relatively high real interest rates, low capital investment and growing inability to invest in infrastructure and education. And investors have been right to worry, since government defaults — including in advanced economies — have been surprisingly frequent.

Enthusiasts for “Modern Monetary Theory” correctly note that governments printing their own currency need never default. Still, such governments have caused countless crises through high inflation and other disguised variations on debt repudiation.

Today’s debt apologists argue that history’s lessons don’t apply to America because the United States issues the leading reserve currency and remains the world’s preeminent geopolitical power. Evidence from faded great powers of the past, however, tells a more worrisome story.

The Roman Empire. Imperial Spain. 18th century France. China in the 19th century during the Qing Dynasty. The United Kingdom starting in the 1920s, but particularly after World War II. Each of those leading powers spent lavishly in some way and undermined their strength by not controlling their spending and debt.

Debt apologists also argue that Japan, whose ratio of gross debt to GDP is above 240 percent, shows that a wealthy country can spend freely and incur large indebtedness without paying any economic price. But Japan’s net indebtedness is far lower, as the government holds an unusually large stock of financial assets.

And the larger truth is that Japan’s economy has paid a considerable price for its extravagant past spending and borrowing. Investment in education and research has fallen behind other leading economies, while venture capital investment and new business creation have languished.

The good news is that history offers abundant evidence that countries with sound institutions can achieve what economists call “fiscal consolidation” — that is, long-term paths back to sustainable finances. Economist Alberto Alesina has documented numerous examples of fiscal consolidation, many taking place after financial crises. The most durable debt reductions, he finds, have typically resulted from sustained spending restraint rather than tax increases.

Evidence that fiscal consolidation can succeed in modern democratic societies comes from Sweden, Denmark and Finland, which experienced severe crises in the early 1990s after two decades of galloping growth in social spending. In each country, parties across the ideological spectrum reached consensus on fiscal prudence and began long processes of thoughtfully reforming their welfare states.

Sweden has reduced its debt/GDP ratio from 70 percent to less than 30 percent, while Denmark has achieved zero net indebtedness, after counting government assets. Fiscal restraint commands 80 percent-plus public support throughout Scandinavia today.

Closer to home, Canada reduced its debt/GDP ratio from 64 percent in 1997 to 31 percent in 2016 — roughly the inverse of America’s move from less than 40 percent in 2008 to 79 percent today. Canada’s achievement also reflects the emergence of a new political consensus after an early 1990s recession. Like Denmark, Canada has experienced faster growth in living standards than America since the late 1990s.

Despite its long history of political contention, America has had one of the world’s best records of fiscal responsibility, until recently. The U.S. government achieved remarkable declines in indebtedness after the Revolutionary War, the Civil War, and the two world wars of the 20th century. From the late 1940s to the 2000s, America’s debt/GDP ratio remained consistently lower than that of most advanced economies, even while America devoted more of its GDP than most to national defense.

In recent decades, America has sustained this track record of discipline in part through a series of political compromises: the Social Security reform of 1983; the Gramm-Rudman Act of 1985; tax laws of 1986 and 1991; the Clinton-Gingrich budget deals of the mid-1990s; and the Obama-Boehner spending deal of 2011. As far as fiscal responsibility is concerned, today’s pattern of partisan intransigence is the exception, not the rule, in modern history.

The lessons of history are clear. Countries that spend and borrow extravagantly do so at their economic and geopolitical peril. But history — including America’s own experience — also teaches that great nations on an unsustainable trajectory can sometimes course-correct. America can, and must, stop the growth in its national debt.