BERLIN, July 17 (Reuters) - The German cabinet plans to approve its 2025 budget on Wednesday after months of wrangling, hoping a strong economic rebound will help it close a 17 billion euro ($18.55 billion) gap between projected spending and revenue.

The euro zone's largest economy skirted a recession at the start of the year but growth has been slower than expected and the German government, like the UK and France, is struggling to plug a budget hole.

The budget for 2025 comes with mid-term financial planning until 2028, the year the armed forces special fund to meet NATO's minimum spending goals is due to run out.

One year before a federal election, reaching agreement on the budget and a long-awaited package to kick-start the economy has been a major test for a coalition often accused of being hobbled by internal disagreements.

In June's European election, the ruling parties in Germany's coalition government fared poorly, with the far-right Alternative for Germany coming second behind the conservatives.

Days after Russia's 2022 invasion of Ukraine, Chancellor Olaf Scholz announced a "Zeitenwende" – German for a historic turning point - with a 100 billion euro special fund to modernise the military and hit the NATO benchmark of defence spending equivalent to 2% of gross domestic product.

In 2028, there is a gap of 39 billion euros in the regular budget, with 28 billion euros needed to comply with the NATO target without the special fund, finance ministry sources said. According to the sources, there is a financing gap of 13 billion euros in 2026 and 2027.

Next year's budget will be less generous to Ukraine, with the government cutting military aid for the country to 4 billion euros from around 8 billion euros in 2024, according to a draft of the budget seen by Reuters.

The government also plans to pass a supplementary budget for the current year on Wednesday with 11 billion euros in additional borrowing, making a total of 50.3 billion euros in net borrowing, the sources said.

Drafting both the 2025 budget and a medium-term financial roadmap through to 2028 was hard because German Finance Minister Christian Lindner demanded a period of fiscal consolidation after higher spending during the COVID-19 pandemic and the more recent energy crisis.

Furthermore, new European Union rules further restrict Germany's fiscal headroom, requiring stricter adjustments than under national regulations, according to the finance ministry.

"I expect every member state to be compliant with our fiscal rules," Lindner said on Monday before a meeting of EU finance ministers. "It's in our best common interest to maintain the sustainability of our public debt." (Reporting by Maria Martinez, Holger Hansen and Christian Kraemer; Editing by Christina Fincher)