After a new tax increase incited weeks of deadly riots in Kenya early this summer, President William Ruto announced that he was reversing course. He abandoned the finance law he had proposed, and then he shook up his cabinet.

Last week, the government reversed itself again. The newly appointed finance minister announced that some of those discarded tax increases would be reintroduced.

The Ruto administration is desperately trying to raise revenue to pay off billions of dollars in public debt and avoid defaulting on its loans, even as critical public assistance and services are being cut.

Governments throughout Africa are facing the same dilemma.

The continent’s foreign debt reached more than $1.1 trillion at the end of last year. More than two dozen countries have excessive debt or are at high risk of it, according to the African Development Bank Group. And roughly 900 million people live in countries that spend more on interest payments than on health care or education.

Outsize debt has been a familiar problem in the developing world, but the current crisis is considered the worst yet because of the amounts owed as well as the huge increase in the number and type of foreign creditors.

And in Africa, a continent pulsating with potential and peril, debt overshadows nearly everything that happens.