Secondary school pupils in England could be kept home every other fortnight if local coronavirus cases soar, new guidance for teachers says.
The plans also say large groups of students - known as "bubbles" - could be told to stay home in the event of an outbreak among pupils.
The education secretary described the measures as an "absolute last resort".
The guidance, published on Friday night, comes just days before millions of pupils go back to school.
Education Secretary Gavin Williamson said the document was a contingency plan for a "worst-case scenario".
"We hope that we won't have to implement the guidance," he said.
The guidance sets out what will happen in schools with a case of coronavirus. If a pupil or staff member has a suspected case, classes will continue as normal while the affected person self-isolates and a test is carried out.
But if a case is confirmed, other pupils could be sent home to isolate for 14 days and to study online.
This will depend on the level of contact between the infected person and other pupils in a "bubble" - with health protection teams to advise.
In a smaller "bubble", such as a single class, all the pupils might have to be sent home to isolate.
For a bigger bubble, such as an entire year group, there is the option to send home all the other pupils, but it could be limited to those who were in direct contact or close proximity or who had travelled with a pupil with the virus.
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 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".
And Patrick Roach, of teachers' union NASUWT, said the government needed to give schools the resources to cope with the potential disruption, including support for remote learning and cover for staff absence due to self-isolation.
"The availability of staff where there is a local lockdown or outbreak may mean that schools have to limit provision if they cannot be staffed safely," he added.
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 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.
In other developments:
- Quarantine requirements for travellers returning from Switzerland, Jamaica and the Czech Republic began at 04:00 BST on Saturday
- A leaked government report suggests a "reasonable worst-case scenario" for the UK this winter is 85,000 deaths due to Covid-19, with more restrictions reintroduced but schools remaining open
- A study from South Korea has found children can carry the virus in their noses for up to three weeks, suggesting that they could pass it on even if they are less susceptible to catching the disease or becoming ill
- And French President Emmanuel Macron has warned of the possibility of a nationwide lockdown after a spike of 7,379 cases on Friday
For schools to respond to changing levels of coronavirus cases, there will be a four-stage set of responses - which prioritise keeping primary school pupils in school full-time.
The default setting will be Tier 1, where all pupils will attend full-time.
If local public health and education officials decide levels of infection are too high, schools could move to a Tier 2 response, in which secondary pupils would go on to a part-time rota. They would be in school for two weeks and then study online at 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.
Analysis: 'Remote learning will still be a reality'
By Dan Johnson, BBC News
Head teachers had asked for a Plan B and here it is - but there's frustration it came just days before more children are due back in the classroom across England.
A suggestion of entire year groups or classes - "bubbles" - having to automatically self-isolate was deleted, but not before it added confusion.
The Department for Education is now pointing to more nuanced guidance about head teachers and public health officials needing to establish who's been in "close contact" with anyone who tests positive.
There's recognition that schools won't be immune from outbreaks in local communities and, while the intention will be to stay open and keep children in class, there's an acknowledgement that further interruptions to learning are possible.
Primary school pupils are the clear priority. Secondary schools will first adopt a rota system before more prolonged disruption, meaning remote learning will still be a reality for some children.
Prof Carl Heneghan, a Oxford University epidemiologist and practising GP, told BBC Radio 4's Today programme schools and families faced "significant disruption", with cold and flu cases meaning more pupils would have to self-isolate until they could be tested.
"If your child has any symptoms they're going to have to stay off school. In the past there's been a tendency to say, you can have some Calpol, maybe you can go in. But there's going to have to be a sea-change in how parents behave with their children," he said.
Geoff Barton, leader of the ASCL head teachers' union, said he felt a "weary, resigned sense of inevitability" to receive the guidance at the last minute, after head teachers had been accused of "treachery" in asking for contingency planning for outbreaks.
He said more needed to be done to support students in exam years who might find their teaching disrupted by periods of self-isolation, including ensuring that they had access to laptops to study at home.
"We have to do better than previously," he said. "We simply cannot have those young people being left at home without clear guidance on what they're going to do."
Prof Neil Ferguson, a former advisor to the government on the pandemic, said primary schools had often only had "the odd case" without evidence of wider transmission, so there was less need to isolate a larger group or introduce a rota.
But he said schools also needed "very rapid testing" of students and staff to control outbreaks.
Labour's shadow education secretary Kate Green told Sky News the guidelines were "long overdue" and it was "unfair" to school and college leaders to release them so close to the start of term.
It said this was "out of date with the latest guidance at the time of publication".
Education staff and parents took to Twitter to express irritation at the timing of the publication.
"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.
Several teachers raised concerns about the possibility of whole year groups being asked to isolate in some circumstances.
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?"
- WILL COVID-19 CHANGE THE WORLD OF WORK FOR GOOD?: Is working from home a long-term solution?
- GROUNDED WITH LOUIS THEROUX: How did these high-profile people cope with lockdown?