The National Botanic Garden of Wales is to receive up to £1.9m extra public money to pay off its debt.
The garden negotiated with the assembly government for months
Deputy First Minister Ieuan Wyn Jones said it was a one-off grant to put the £43m garden on a sound financial footing to attract private investment.
The money it receives each year from the assembly government will rise from £150,000 to up to £550,000.
Managers of the garden at Llanarthne in Carmarthenshire welcomed it as a "monumental milestone".
Two months ago, it emerged that garden managers were in talks with the assembly government to remove the debt and increase its annual grant.
Revealing the outcome of those talks, Mr Jones told AMs that the garden had met all the recovery targets it had been set.
Carmarthenshire County Council also announced that it would convert an existing £1.35m loan into a grant and provide a further package of financial support to the garden, with funding matched by the assembly government.
Mr Jones said it was vital to "value our national institutions, wherever they may be in Wales".
"The National Botanic Garden of Wales has proved, beyond doubt, its value to the people of Carmarthenshire and beyond", he said.
"It has the potential, however, to make an even more valuable contribution and...in addition to maintaining the current visitor offer there needs to be further work in attracting new and returning customers," Mr Jones added.
The minister said the funding would allow the development of a range of new projects, including science and education programmes.
Garden director Kevin Lamb said: "We have been working hard to achieve this landmark agreement for more than a year.
"It's been on the top of my agenda since I arrived here at the garden in January 2007 and this is a great day for everyone connected with this fabulous place, with Carmarthenshire - and all of Wales."
The size of the assembly government's annual grant for the garden will be reviewed in 2010.
The garden was opened in July 2000 and developed at a cost of £43m with half on the money coming from the lottery funded Millenium Commission.
Accounts for the 2005/2006 financial year showed that it had depended on an overdraft to pay its day-to-day "capital requirements" and auditors KPMG had warned that uncertainties may cast doubt about the ability of the garden to continue as a going concern.
No further payments
In 2002 and 2003 the garden received nearly £2m in aid from the assembly government and the lottery, but warned in October 2003 it may have needed to call in the receivers.
A rescue package was announced by the assembly government, Carmarthenshire Council and the Millennium Commission with each contributing £300,000.
The then culture minister Alun Pugh said there would be no further payments from the assembly government after 2009 to stabilise the garden.
In 2004/5 102,000 visitors visited the garden.
The projected visitor number for the current financial year is 125,000.
Last November it was announced that the assembly government would wipe out the £13.5m debt of the Wales Millennium Centre in Cardiff Bay and treble its annual revenue funding from £1.2m to £3.7m.