ROME—Italy’s populist government has offered to shore up an ailing bank with public money, in a sharp U-turn after attacking mainstream politicians for years for bailing out banks with taxpayers’ money.

The country’s embattled banking sector will provide a delicate test for the new government, as Italian lenders—whose bondholders include many ordinary savers—struggle to digest billions in bad loans accumulated during the financial crisis and shore up their fragile finances.

...