Thousands of British teenagers are to be given training in cyber security to boost the UK’s defences against the rising threat of online attacks.

The new Cyber Schools Programme aims to teach pupils some of the skills they would need to help defend Britain’s businesses and institutions against online threats.

Allegations of Russian interference in the US elections and continued “cyber warfare” and espionage from China have sparked fresh fears over the threat posed by hacking.

Isis and other terrorist groups have also invested in their own cyber branches, while Islamist hacking groups such as one that recently attacked a series of NHS websites have sprung up around the world.

The Government is now aiming to guard against a future skills shortage amid mounting concern over the damage hackers or terrorists could inflict on the economy and infrastructure.

Ministers are making up to £20m available for extracurricular sessions that will see expert instructors drafted in to teach, test and train selected teenagers.

A “cyber curriculum” will be drawn up to mix classroom and online teaching with real-world challenges and hands-on work experience.

A message left on NHS websites hacked by the Tunisian Fallaga Team (youtube)

The scheme, led by the Department for Culture, Media and Sport (DCMS), is aimed at those aged between 14 and 18, with a target for at least 5,700 teenagers to be trained by 2021.

Matt Hancock, the digital and culture minister, said: “This forward-thinking programme will see thousands of the best and brightest young minds given the opportunity to learn cutting-edge cyber security skills alongside their secondary school studies.

"We are determined to prepare Britain for the challenges it faces now and in the future and these extracurricular clubs will help identify and inspire future talent."

Participants will be expected to commit to four hours a week, with flexibility around exams and busier study periods, starting at 14 to complete a four-year course.

Older teenagers will be able to join at any point providing they meet the right criteria for the programme, which is being opened up for private bids ahead of a pilot launch in September.

The announcement came days after The Independent revealed that Islamist hackers linked to Isis carried out an attack on a series of NHS websites, exposing serious flaws in security systems meant to protect sensitive information.

Graphic images of violence from the Syrian war were put up on the sites by a group called the Tunisian Fallaga Team, which declared it was carrying out the electronic raid in retaliation to the West’s aggression in the Middle East.

It is believed that patient data was vulnerable in the attacks, but initial checks do not indicate that any had been compromised.

The Tunisian group, as well as others including the Global Islamic Caliphate and Team System DZ, all connected to Isis, are said to carry out coordinated operations.

Sony Cyber Attack: The Worst Affected In Hollywood Show all 13 1 /13 Sony Cyber Attack: The Worst Affected In Hollywood Sony Cyber Attack: The Worst Affected In Hollywood Leonardo DiCaprio The actor's 'horrible behaviour' over Steve Jobs biopic was branded 'actually despicable' in leaked Sony executive emails Getty Images Sony Cyber Attack: The Worst Affected In Hollywood Seth Rogen Seth Rogen and James Franco cancel Interview (North Korea-baiting film) press appearances after Sony hackers' threats Sony Cyber Attack: The Worst Affected In Hollywood James Franco Seth Rogen and James Franco cancel Interview press appearances after Sony hackers' threats AP Sony Cyber Attack: The Worst Affected In Hollywood Aaron Sorkin The screenwriter has said that the people who hacked into Sony Entertainment Pictures and released private emails are 'threatening the lives of whole families' Theo Wargo | Getty Images for Nantucket Film Festival Sony Cyber Attack: The Worst Affected In Hollywood Amy Pascal Also leaked: Sony Pictures co-chair Amy Pascal's email joking about President Barack Obama's race Getty Images Sony Cyber Attack: The Worst Affected In Hollywood George Clooney Leaked email chain between Pascal and George Clooney appeared to reveal just how much the actor struggled to cope with the criticism of his The Monuments Men Getty Sony Cyber Attack: The Worst Affected In Hollywood Barack Obama Sony executives Scott Rudin and Amy Pascal's leaked email exchange jokes about Barack Obama favouring films with black actors Getty Sony Cyber Attack: The Worst Affected In Hollywood Channing Tatum Channing Tatum's leaked Sony executive email responding to the success of 22 Jump Street with Jonah Hill, which became the highest grossing R-rated comedy ever when it opened in June this year Getty Images Sony Cyber Attack: The Worst Affected In Hollywood Jaden and Willow Smith Will Smith and Jada Pinkett Smith's children Willow and Jaden Smith found themselves in the Sony inbox as well Getty Sony Cyber Attack: The Worst Affected In Hollywood Mark Gordon DiCaprio's exchange with Jobs TV producer Mark Gordon (pictured) was leaked too Getty Images Sony Cyber Attack: The Worst Affected In Hollywood Princess Beatrice Sony hackers linked to North Korea revealed Princess Beatrice earns $30,000 a year Sony Cyber Attack: The Worst Affected In Hollywood Michael Fassbender Aaron Sorkin's leaked emails claimed he had no idea who actor Michael Fassbender (pictured) was Getty Images Sony Cyber Attack: The Worst Affected In Hollywood Scott Rudin Information leaked has also included embarrassing emails involving high profile producer Scott Rudin attacking Angelina Jolie Getty Images

As well as airlines and media companies, the groups had broken into the US Central Command's Twitter and YouTube accounts and had published personal details of retired US military personnel.

Isis’ Syria-based hacking efforts were thought to be led by Junaid Hussain, a British-Pakistani militant who was previously jailed for infiltrating Tony Blair’s accounts and posting personal information online.

The 21-year-old was killed alongside two other Isis fighters in an American drone strike that hit his car in Raqqa in August 2015.

MPs have warned that confidence in the Government's ability to protect Britain from high-level online attacks is being undermined by skills shortages.

The Public Accounts Committee warned last week the threat of electronic data loss from cyber crime, espionage and accidental disclosure has risen considerably in recent years.

GCHQ dealt with 200 national security incidents a month in 2015 – double the number it was handling in the previous year – and the number is expected to rise.

It has been scouting for new talent, with teenage girls invited to join a competition last month.

The National Cyber Security Centre was launched last year with a £1.9bn investment to counter the threats.