BERLIN—There is a ticking demographic time bomb in fast-aging Germany that threatens the country’s generous welfare system.

Politicians’ reaction: Spend more money on pensioners.

At a meeting on Thursday night, Chancellor Angela Merkel’s government agreed to spend nearly €4 billion ($4.2 billion) more on pensions annually in a bid to bolster the incomes of people in eastern Germany and those unable to work.

And this is just the beginning. With next year’s general election approaching, parties are jostling to grab votes from the bulging cohort of current and soon-to-be pensioners with promises economists warn could put a huge burden on Europe’s largest economy.

These range from guaranteeing a minimum pension for some workers to raising pensions for everyone and injecting more taxpayer money into the system, all of which would add tens of billions of euros to its vast financing needs.