Serial coronavirus testing will be rolled out in schools and colleges across Wales from January.
The Welsh Government has announced the plans which would see pupils and staff identified as close contacts asked to either self-isolate as normal or take a lateral flow test at the start of the school day for the duration of the self-isolation period.
Those who test negative would be able to continue going to school as normal, while those who test positive would have to self-isolate and also book a confirmatory test.
Schools and colleges will be offered support, training and equipment needed.
Staff members working in special schools in Wales will be offered weekly testing.
Education minister Kirsty Williams said: “Throughout this pandemic our priority has been to deliver maximum learning with as minimal disruption as possible.
“The plans we are announcing today will play an integral role in delivering on that priority.
“We recognise that it has not been easy for pupils and staff who have been required to self-isolate as a result of having been identified as a ‘close contact’ and we recognise the impact it has had on face-to-face teaching.
“Earlier this month we announced the reduction in the period of time for which a person needs to self-isolate from 14 days to 10 days.
“Following discussions with Public Health Wales and the Children and Schools Technical Advisory Cell, we are pleased to confirm that we will introduce a serial testing programme in schools and further education settings in the new year.”
Lateral flow testing (LFT) detects the presence of the Covid-19 viral antigen from a swab sample.
They are hand-held devices which produce results within 20 to 30 minutes, with the potential to be self-administered.
Minister for health and social service, Vaughan Gething added: “The lessons we have learnt from using LFTs in pilots in higher education institutions across Wales and secondary schools in Merthyr Tydfil and Rhondda Cynon Taf will help inform how we can successfully deliver lateral flow testing in schools and other education settings in the future.
“It is vital everyone understands that testing alone cannot eradicate the risks associated with contracting and transmitting Covid-19.
“Testing helps to mitigate the risk but it needs to be taken alongside other infection prevention control measures, including appropriate social distancing and hand hygiene measures.
“We are grateful to everyone in the sector who has worked hard to make sure these measures are in place.”
Find the latest coronavirus figures for your area:
The Welsh Government intends to roll out testing to all schools and further education settings, including primary and childcare staff.
But in order to make sure there is a model that works and is safe, the rollout will be phased on levels of risk starting with secondary schools and further education settings.
This comes after it was announced on Thursday that all secondary schools and colleges in Wales would be shutting from Monday, December 14.
Instead, they will move to only learning for the last week of term.
Primary schools and special schools have been encouraged to stay open, however, those in Cardiff, Ceredigion, Swansea, Neath Port Talbot and the Vale of Glamorgan will see face-to-face teaching end earlier than planned.