Schools across the UK are to close indefinitely, with A-level and GCSE exams cancelled, as the government made another sudden escalation in its efforts to curb the increasing spread of coronavirus.

The prime minister, Boris Johnson, said he had been been forced to close classrooms for up to 8 million pupils in England – the first countrywide school shutdown in modern British history – as the virus spread faster than anticipated, forcing teachers and pupils to self-isolate.

Coronavirus: why are UK schools closing and what does it mean for parents? Read more

The decision came hours after Scotland and Wales announced their own blanket school closures, and thousands of schools in England decided unilaterally to close or turn away pupils amid staff shortages and parents’ concerns.

Schools will remain open, however, for the supervision of hundreds of thousands of children of NHS staff and other frontline workers, as well as for vulnerable children, Johnson said. He also announced a national voucher scheme to ensure that pupils eligible for free school meals get a meal each day, and said that this summer’s exams would be replaced by teacher assessment.

On a day of rapid policy shifts as the UK death toll from the Covid-19 virus exceeded 100, it also emerged that London faces a potential lockdown similar to those carried out in other European cities, with Johnson warning the country that he is prepared to take “further and faster measures”. Stringent action to enforce social distancing is not expected within the next two days.

Meanwhile, the Ministry of Defence is to double the size of the military’s civil contingency unit to create a 20,000-strong Covid-19 support force, the defence secretary has announced, while reservists could also be called up to support the police or enforce lockdowns.

Gavin Williamson, the education secretary for England, told parliament on Wednesday: “After schools shut their gates on Friday afternoon they will remain closed until further notice. This will be for all children, except for those of key workers and for children who are the most vulnerable.”

Williamson also confirmed: “We will not go ahead with assessments or exams, and we will not be publishing performance tables for this academic year. We will work with [the] sector and have to ensure children get the qualifications that they need.”

The 5pm announcement – which affects about 25,000 state and private schools in England – came as Johnson rushed to catch up with the devolved administrations in Wales and Scotland, which pre-empted Westminster by revealing that their schools were to close and – in the case of Wales – exams were to be scrapped. Soon after, Northern Ireland also announced the closure of all schools.

Kirsty Williams, the Welsh minister for education, said: “From next week, schools will have a new purpose. They will help support those most in need, including people involved in the immediate response to the coronavirus outbreak.”

Facebook Twitter Pinterest Some private and public schools such as Eton College announced their closures due to coronavirus concerns ahead of schools in the state sector. Photograph: Matthew Fearn/PA Wire

The Westminster government also had its hand forced by thousands of schools in England that were closing or turning away pupils because of severe staff shortages, including Eton College, the prime minister’s former school.

Passmores Academy – a secondary school made famous by Channel 4’s Educating Essex documentary series – told parents on Wednesday morning that it would close until after Easter because of staff shortages caused by coronavirus restrictions.

Other schools said they would have closed anyway, because of pupils staying away in droves for the second day in a row after Monday’s announcement of more stringent coronavirus isolation and social distancing measures.

Johnson and his advisers had sought to delay school closures for as long as possible, fearing the disruptive impact on key workers, including healthcare staff, who would struggle to care for their children.

The prime minister stressed that schools remained “very safe environments” and said there had been a “trade-off” in deciding the best moment for them to close.

He appeared sensitive to the charge that the decision had been forced on the government, after the UK became almost the last country in Europe where schools had not been closed, and amid mounting chaos as pupils and teachers took their own decision to remain at home.

“Hitherto the advice has been that we should keep schools open if possible, in order to reduce the pressure on the NHS and on all other public services. But I think you’ll agree I have always been very clear that this is a balanced judgment and one that we have kept under constant review,” Johnson insisted.

Announcing the closures, Williamson told MPs: “The spread of the coronavirus is increasing at a faster pace than anticipated.” He added: “It is clear that schools are increasingly finding it more difficult to continue as normal as illness and self-isolation impacts on staffing levels and pupil attendance.”

Both Johnson and Williamson refused to say how long the schools shutdown could last, although discussions with the Department for Education (DfE) suggest schools are unlikely to return until the new term in September, “barring a miracle”.

Coronavirus: the week explained - our expert correspondents put a week’s worth developments in context in one email newsletter

Head teachers said they were relieved the government had finally made a decision, ending weeks of speculation. But they also said they wanted to hear more detail over their role in the coming weeks and months.

“The situation is moving very quickly, and we have more questions than answers at the moment. There are many complicated issues to address immediately,” said Paul Whiteman, general secretary of the National Association of Head Teachers.

The National Education Union also welcomed the decision to drop exams scheduled for next term, including Sats - standardised tests – for primary school pupils aged seven and 11.

The DfE and the Welsh and Scottish governments said more details would be released on Thursday, when the government in England is expected to lay out the sectors and industries where staff qualify as key workers.

Local authorities in England have already begun contacting parents, asking them to define themselves as a “key worker”. Those who are will be able to send their children into school for supervised care from Monday.

Williamson said “examples of these workers include NHS staff, police and supermarket delivery drivers who need to be able to go to work to support the country’s fight to tackle coronavirus”.

Vulnerable children will include those who have a social worker and those with an Education, Health and Care Plan (EHCP) – a legal document that describes a child’s special educational needs and the support they require.

Williamson later told MPs that teachers and social workers would also be classed as key workers, increasing the number of children who could potentially be looked after in schools into hundreds of thousands.

Jules White, a head teacher from Sussex who had publicly called for the government to provide leadership, said: “Schools will be ready to help the children and families that we serve. Even above GCSE and A-level exams, the first priority must be to keep vulnerable children safe, looked after and properly fed. This is our bread and butter and we will step up.”