A single confirmed case of coronavirus in a school in England could mean sending home an entire year group, according to new government guidance.
It says a confirmed case could mean all the pupils in the same "bubble" having to isolate for 14 days.
In areas with a local lockdown, secondary pupils could be put on a rota of two weeks in and out of school.
The guidance, published on Friday night, comes just days before millions of pupils go back to school.
Education Secretary Gavin Williamson described it as contingency plans for a "worst case scenario".
"We hope that we won't have to implement the guidance set out today," said Mr Williamson.
"Changes to school attendance will only be an absolute last resort."
Paul Whiteman, leader of the National Association of Head Teachers, said: "Keeping schools open has to be the priority, but you don't need a crystal ball to see that there will almost inevitably be some disruption in some areas in the coming weeks."
He said that heads had been asking for weeks for this "Plan B" for what happens in the event of an outbreak - and "another late night publication is fairly typical of what we've become used to".
Meanwhile, Health Secretary Matt Hancock has not ruled out nationwide restrictions should England see a spike in coronavirus cases this winter.
Mr Hancock told The Times that a second wave was "a very serious threat" and that, under a "reasonable worst-case scenario", Britain could be faced with a spike in Covid-19 cases and a bad outbreak of seasonal flu as people spend more time indoors.
Image copyright PA MediaThe new guidance sets out what would happen if there are coronavirus cases in a school - and what happens to schools in areas where there are higher levels of infection.
If there is a suspected case of a pupil or staff member, the school will continue while a test is carried out.
But the Department for Education says: "If a case is confirmed, local public health officials will work with the school to take appropriate measures, including asking all members of a pupil's bubble to isolate for 14 days and access remote education."
A "bubble" could be a small number of children - but it could also be an entire year group - and it could mean all of those pupils having to leave school to isolate for 14 days and switch to distance learning.
The guidance says that a health protection team would decide which specific pupils are considered to have been in close enough contact to have to go into isolation.
Tiers of concern
For schools to respond to changing levels of coronavirus cases, there will be a four-stage set of responses - which will all prioritise keeping primary school pupils in school full time.
The default setting will be Tier 1 - which will be where there are no particular problems, with the assumption that this will be the great majority of schools, where all pupils will attend full time.
If local public health and education officials decide there are too high levels of infection, schools could have a Tier 2 response, in which secondary pupils would go on to a part-time rota, in school for two weeks and then studying online from home for two weeks.
The guidance says schools would only be affected in this way after "all other measures have been exhausted" - but it says this would help to break the chain of Covid-19 transmission.
A more severe response would be Tier 3, in which most secondary pupils would study from home, and then Tier 4, in which all types of school would switch to studying from home, except for the children of key workers and vulnerable children.
Geoff Barton, leader of the ASCL head teachers' union welcomed the contingency planning.
"But to wait until the Friday night before most schools return isn't the government's finest moment. Obviously, schools haven't had any chance whatsoever to incorporate this into their planning and will now have to revisit the plans they have put in place.
Image caption Schools are preparing to welcome all pupils for the first time since March"In any event, it is a step in the right direction. Obviously, everybody will be hoping that these back-up plans aren't needed and that schools are able to remain fully open."
Education staff and parents took to Twitter to express irritation at the timing.
"The timing of this shows total disregard for schools, leaders and teachers. It is utterly breathtaking that this is how we are repeatedly treated," said deputy head Daniel Sabato,
Claire Sheehan said: "Our school waited until late this week to send guidance in case stuff changed."
It felt like the government was "full of the same people [who] wd send redundancy emails 530 fri", she said.
There were questions about what the advice meant.
"As a sixth form college, our bubble would be half of the students. Does that include all staff who have taught them too? Cause that could be all the staff," said geography teacher Claire Foulkes.
While head of geography Mark Enser asked: "Staff in most secondaries are teaching across year group bubbles - who would be in school to teach the rest?"
"I'm a dinner lady, and the lunch hall is a communal area that face masks can't be worn in," said Trudi Gard.
"The dinner ladies come into contact with all children from all bubbles. If a child infects us, we infect everyone else."