The vote in the Bundesrat on Friday was the last major hurdle the package had to clear before being signed into law, ending decades of fiscal conservatism in Europe's largest economy.Â
The legislation, which creates a 500 billion-euro ($A861 billion) fund to spend on infrastructure and eases strict borrowing rules to allow higher spending on defence - passed the Bundestag lower house on Tuesday.
The conservatives and SPD, who are in talks to form a coalition after an election in February, pushed it through the outgoing parliament for it could be blocked by an enlarged contingent of far-left and far-right MPs in the next Bundestag starting on March 25.
Chancellor-in-waiting Friedrich Merz has defended the tight timetable, which angered fringe opposition parties, by pointing to a rapidly changing geopolitical situation.
European leaders fear shifts in US policy under President Donald Trump in particular could leave the continent exposed to an increasingly hostile Russia and assertive China.
"The threat from the east, from Moscow, is still present, while the support from the West is no longer what we were once accustomed to," Bavarian Premier Markus Soeder said.
"I am a convinced trans-Atlanticist, but the relationship of trust in the United States of America has, at least for me and for many others, been deeply shaken. The Germans are worried."
The approval of the legislation hands Merz, whose conservatives won February's election, a major win before he is even sworn in as chancellor.
But it has also cost him support. Merz spent the election campaign promising not to immediately open the spending taps only to announce a tectonic shift in fiscal policy days after winning.
Some voters, including within his own camp, have accused him of voter fraud, and polls in the past week showed a drop in support for his conservatives in tandem with a rise for the far-right Alternative for Germany.
The 69-year-old, whose conservatives won the election, hopes to conclude coalition talks with the SPD by Easter.