Scottish schools have been asked to start preparing for the return of pupils in the autumn.
First Minister Nicola Sturgeon told the Scottish Parliament that staff would begin work next month to prepare classrooms for the next term - and "a different model of learning".
She said all schools would reopen from 11 August using a "blended model".
This would involve part-time study in school combined with some learning at home.
Ms Sturgeon said she wanted to give "a huge thank you to parents, carers and teachers" for their work during lockdown.
In her statement on plans to ease lockdown restrictions in Scotland, Ms Sturgeon also said transition support would be given, where possible, to children going into Primary 1 or moving from primary to secondary schools.
The Scottish government has published a strategic framework document explaining the factors which contributed to its plan for the reopening of schools.
The precise date for pupils to return to class will have to be confirmed by local authorities.
Before the new school term starts, "an increased number of children" will be provided with the type of childcare that has been on offer to the children of key workers.
Phase 1 of the lockdown will allow childminders to reopen and the first minister said all early years childcare providers would reopen over the summer "subject to necessary health measures".
A further £30m is being offered to provide laptops for disadvantaged children to reflect the fact that pupils will continue to be learning part of their time at home.
Ms Sturgeon said she had a special message for children and young people themselves - "on the off chance that any of you are watching a parliamentary statement".
"I know how difficult it has been for you not to be at school and with your friends," she said, "but you have been magnificent during this lockdown period - thank you."
The Scottish government said an agreement had been reached between councils, professional associations and parent representatives.
It includes expanding the physical space available for teaching by making use of libraries, community halls, leisure centres, conference venues, and taking short-term leases of vacant business accommodation.
Other key points include:
- Schools will implement physical distancing measures, such as providing seating that is two metres (6ft) apart and staggering arrival, departure and break times.
- Class sizes will be significantly reduced as a result of the new way of working, with most pupils spending around half their time in class and half learning at home. Time in school will increase further as soon as it is safe to do so.
- Innovative use will be made of existing teachers and staff and, where necessary, consider the role former teachers can play either by returning to the classroom or teaching virtually to support in-home learning.
Deputy First Minister John Swinney said the "overriding priority" was to ensure the health and wellbeing of pupils and staff.
Councils will have to change the planned dates of the school holidays - in many areas, schools were due to go back later than 11 August.
It's also likely that 11 August may be used for in service teacher training in some areas so pupils may not actually go back on that day.
Councils or individual schools will confirm to parents exactly when their children will be back in the classroom.
But learning will be very different as long as social distancing measures remain in force.
Schools are looking at what's described as "blended learning" - a mix of:
- ordinary classroom learning
- online learning
Perhaps the biggest question concerns the timetable. Schools and councils are looking at a number of potential options.
These could see some children at school in the morning while others attending after lunch. Or it could see different groups of children attending on alternate days or even alternate weeks.