(Bloomberg) -- Senior officials in Germany’s ruling coalition meeting in Berlin on Monday were under no illusion about the magnitude of the task they face after last week’s shock budget ruling by the nation’s top court.

“The house is in flames,” one participant announced grimly at the emergency gathering of deputy ministers, according to people familiar with the talks.

It’s hard to overestimate the potential impact of Wednesday’s dramatic judgment by the Federal Constitutional Court, both on Germany’s longer-term fiscal policy and the continued existence of Chancellor Olaf Scholz’s fractious three-party alliance.

In delivering their verdict on a challenge filed by the main opposition conservatives, the red-robed judges in Karlsruhe called into question hundreds of billions of euros of financing in special funds — some of them decades old — that are not part of the regular federal budget.

Scholz and his partners from the Greens and the Free Democrats are engaged in near non-stop negotiations to address the unprecedented political turmoil that threatens to blow their coalition apart, said the people, who asked not to be identified discussing confidential talks.

While acknowledging the scale of the task, Monday’s meeting of deputy ministers was also marked by a constructive spirit and officials agreed that if the alliance can find a solution to such an immense challenge then anything is possible, said one of the people when describing the mood in the room.

Scholz and other senior officials have canceled some public appearances this week, clearing their calendars to deal with the upheaval.

A former finance minister under Angela Merkel, the Social Democrat chancellor is deeply involved in the effort to find a solution that respects the ruling in all its complexity and is legally watertight against future challenges, according to the people.

Coalition officials have set themselves an unofficial deadline to reach an agreement by Thursday noon at the latest, the people said. Lawmakers are due to meet immediately after that to put the finishing touches to the 2024 federal budget and solve any issues for this year’s finance plan, they added.

“We are all in constant contact,” a drained-looking Robert Habeck, the Greens Economy Minister who is also the vice chancellor, told reporters in Jena on Tuesday.

Underlining the drama of the situation, the Finance Ministry on Monday froze virtually all new spending authorizations for this year as it assess the broader and longer-term impact for the federal budget, according to a letter sent to government ministries seen by Bloomberg.

For now, market reaction to the ruling has been limited, though over the longer term it could prove supportive given the prospect of lower issuance next year. Commerzbank AG strategists estimate that gross bund supply could fall below €250 billion ($274 billion) in 2024 compared to their current forecast of €264 billion.

As the government races to find solutions, one proposal on the table is a drastic overhaul of this year’s finance plan, including another suspension of the so-called debt brake which limits net new borrowing but can be suspended in times of emergency.

Read More: German Budget Chaos Risks Painful Delays to Greening Industry

If officials conclude that the court judgment broadly applies to most of Germany’s off-budget funds, as expected, Finance Minister Christian Lindner will have to retroactively account for at least €30 billion of new debt in a revised program for 2023, people familiar with the discussions told Bloomberg on Monday.

Lindner would be forced to reverse the restoration of the debt brake he insisted on for this year, in what would be a painful setback for the FDP chairman, who sees himself as a guardian of Germany’s public finances.

In what may be the first hint of an imminent climbdown, one of Lindner’s economic advisers was quoted as saying Tuesday that a retroactive emergency suspension of the debt brake for 2023 would be justifiable.

If the government had had prior knowledge of the constitutional court’s ruling at the end of 2022, “it would have had to apply for the emergency budget situation for this year, in relation to the energy crisis, and could have justified this,” Lars Feld, who is also a professor of economics at Freiburg University, told the Rheinische Post newspaper.

--With assistance from Kamil Kowalcze and Alice Gledhill.

©2023 Bloomberg L.P.