The Scottish government has struck a funding deal of almost £2bn with councils to fund a flagship policy to boost early learning and childcare.
Ministers have pledged to increase free nursery provision from the current 600 hours to 1,140 by August 2020.
But spending watchdog Audit Scotland warned in February of a “significant risk” that local authorities would not be able to fund the expansion.
The government and Cosla said they had now reached a “landmark agreement”.
The deal means £990m will be spent on day-to-day funding for the scheme by 2021.
This is £150m more than the government’s previous estimate. Opposition politicians had previously warned of a £160m “black hole” in the funding proposals.
Funding will rise annually from £33m this financial year to £567m by 2021/22, totalling £1.5bn over five years.
The government will give a further £476m in capital funding between 2017/18 and 2020/21 for building work needed for the childcare increase.
Childcare and Early Years Minister Maree Todd said the agreement “marks the culmination of more than two years of hard work to establish a robust shared understanding of the costs attached to the expansion”.
She added: “With thanks to councils the expansion plans are now well under way and will be backed by almost £1bn of annual public investment by 2021/22”.
Cosla’s resources spokeswoman Gail Macgregor said councils were “fully committed” to expanding early learning and childcare expansion to 1,140 hours.
She said: “We needed to get this policy right from the start, together with the level of funding. I think we have achieved this by working together.”