The move comes amid growing concern about the newly-detected strain of coronavirus, which is believed to be more contagious that previous variants like delta.
From 4am on Tuesday, any traveller aged 12 or over, regardless of their vaccination status, will have to show proof of a negative PCR or lateral flow test taken no more than two days before departure for the UK.
Airlines will be required to check for pre-departure tests alongside completed passenger locator forms.
From Monday, Nigeria will be added to the red list of high-risk countries from which travellers must undergo hotel quarantine for 10 days after entering Britain.
Health secretary Sajid Javid said the government’s strategy since the discovery of the omicron variant had been to “buy time” to assess and to “put in place protective measures”, adding “we’ve always said that we would act swiftly should new data require it”.
With 134 cases now detected in the UK, he said that further action to slow the incursion of the omicron variant was being taken “in light of the most recent data”.
It is understood that the move to pre-departure testing was prompted in part by evidence that the time delay between infection with the omicron variant and becoming infectious to other people is shorter than with other strains. This increases the efficacy of pre-departure testing, as it is more likely to identify positive cases.
Mr Javid added: “Over the recent days we have learnt of a significant number of growing cases linked to travel with Nigeria. Nigeria now is second only to South Africa in terms of linked cases to omicron.”
The announcement comes after pressure on the government to tighten travel rules, with Labour calling for the reintroduction of pre-departure tests and the government’s scientific advisory body Sage saying they would be valuable.
Shadow home secretary Yvette Cooper welcomed the move but said the government had been “too slow” to act.
“Finally!” she said. “But why on earth is this still only being brought in nearly two weeks after Omicron was identified?
“(Shadow health secretary) Wes Streeting and I called for this, Sage recommended this and I am relieved the government is finally acting.
“Ministers repeatedly said pre-travel tests were not needed when we pressed them on this. I’m very glad they’ve U-turned now, but I wish they’d done so faster.
“Lessons for omicron from the first wave and delta wave are that if lots of separate new cases seed in the UK it accelerates the pandemic.”
It was greeted with horror by the travel industry, which has already been hit by the addition of South Africa and nine other southern African countries to the red list, barring inbound travel for anyone other than UK and Irish citizens.
British Airways’ Chairman and CEO Sean Doyle said: “The blanket re-introduction of testing to enter the UK, on top of the current regime of isolation and PCR testing on arrival is completely out of step with the rest of the world, with every other country taking a measured approach based on the science.
“Our customers will now be faced with uncertainty and chaos and yet again this a devasting blow for everyone who works in the travel industry.”
And the CEO of industry body Airlines UK, Tim Alderslade, added:“It is premature to hit millions of passengers and industry before we see the full data. We don’t have the clinical evidence.
“The red list extension made complete sense - that’s what it’s there for - but we know from experience that blanket restrictions do not stop the importation of variants. It’s already here.
“They’ve now changed their travel advice twice within a week and it’s just impossible for anyone to plan. These measures must be removed as quickly as possible in line with the speed of the booster programme.”
The chief executive of the Airport Operators Association, Karen Dee, said that pre-departure tests will act as a “major deterrent” to travel.
“This is a devastating blow for aviation and tourism,” she said.
“Pre-departure tests act as a major deterrent to travel and most of the limited remaining demand following the reintroduction of self-isolation will now fall away, just as airports were hoping for a small uplift over the Christmas holiday.”
Transport secretary Grant Shapps said: “As the scientists work to understand the new omicron variant, we need to apply additional caution until the picture is clearer.
“We appreciate this will be difficult for the travel sector as we prioritise public health and protect the progress of our world-leading vax and booster programme.”
He added: “As we learn more about the omicron variant, we will review these temporary measures to ensure they continue to be proportionate and necessary to protect public health.”