Some of Scotland's most vulnerable young people are to be given greater rights to to continue their care placement into early adulthood.
The Scottish government said the change would come into effect from April 2015.
The Children and Young People Bill will allow for teenagers in residential, foster or kinship care to remain looked after until the age of 21.
Young People's Minister Aileen Campbell said the bill would help ensure a "positive future" for those affected.
Ms Campbell added: "Care leavers in Scotland currently receive care and financial support up to the age of 21 and we have already committed to extending this to 26.
"We are now able to announce that, from April next year, those 16-year-olds in foster, kinship or residential care will have a right to stay up until the age of 21 before receiving aftercare.
"We are committing £5m a year for these improvements as we take steps with our partners in the sector to give young people in care the same opportunities and positive future that their non-looked after peers enjoy."
Barnardo's Scotland director Martin Crewe said: "Allowing care leavers to return to some form of care, and increasing the number who can receive enhanced support after leaving care, will help particularly vulnerable young people when they need it the most."
Duncan Dunlop, chief executive of Who Cares Scotland, added: "The number young care leavers who will benefit from these changes is significant and I don't know of any other country in the world who has made a commitment like this.
"Young people from care are some of the most resilient young people in Scotland. They have to be given what they have faced in their young lives."
Scottish Labour's education spokeswoman Kezia Dugdale welcomed the proposal.
She said: "I am delighted for care leavers and the organisations working to support them that the Scottish government has now listened to what they, along with Labour MSPs, have been saying on the need for improved access to services for looked-after children as they reach adulthood."
Scottish Liberal Democrat education spokesman Liam McArthur MSP said he supported what he called a "change of heart" by ministers.
He said: "While these proposals were not initially supported by ministers, I am pleased that they have relented following pressure from the education committee and charities involved in supporting those going through the care system.
"What this demonstrates clearly is that where there is a political will, there is a way to act now."