Cyprus’ parliament approved a bailout agreement with the European Union on Tuesday. And though rejecting the deal would have triggered a national default, the lawmakers accepted it by a mere 29-27 margin.

Considering that the alternative was a national default, the high level of opposition to the austerity measures imposed by the EU and the International Monetary Fund re-confirmed how hard it is to stop a runaway debt train.

Such reflexive resistance isn’t limited to Cyprus or the rest of Europe. As government benefits there — and here — have grown over the decades, so has public demand for more than taxpayers can afford.

A series of debt meltdowns in Europe in the last few years illustrate what happens when national governments’ balance sheets reach their breaking points.

In Greece, Spain and other countries awash in red ink, such financial messes have triggered not just marketplace chaos but civil discord.

Some prominent economists, including New York Times columnist Paul Krugman, persist in arguing that the push for overdue austerity in Europe — and in the United States — is the wrong approach.

However, you can’t get out of debt by adding more debt. And if any nation keeps spending beyond its means by printing more money, it puts its currency at risk. That maxim includes our nation — and our dollar.

Meanwhile, though Cypriot lawmakers’ willingness to tighten their belts Tuesday was welcome, this other economic news from the continent wasn’t:

Unemployment in the 19-nation Eurozone rose to a record 12.1 percent in March. That included a stunning 26.7 percent jobless rate in Spain.

When unemployment rises, government’s ability to pay its way is diminished, with less revenue and more benefits to fund. That tough lesson has hit home in the United States over the last five years.

The deal that tiny Cyprus took Tuesday lawmakers features $13.2 billion in aid from the European Union and the International Monetary Fund. Our national debt is $16.77 trillion — and climbing.

Thus, Europe’s proliferating debt disasters should be instructive for us.

We can learn that bottom-line lesson, or we can pay a much more painful price later.