The UK’s Prevent counter-extremism programme is to undergo an independent review, the government has announced after years of controversy.

Ministers and senior police officers had previously dismissed criticism and urged communities to support the scheme, resisting persistent calls to overhaul or rebrand it.

But on Tuesday the security minister said the “time was right to initiate a review of Prevent”.

“Communities across the country have got behind Prevent and are contributing to it because they want, as we do, their own young people to be protected from grooming and exploitation by terrorists,” Ben Wallace added.

“I am proud we have helped divert hundreds of people away from posing a real threat and put them back on the path of living a fulfilling law-abiding life.

“This review should expect those critics of Prevent, who often use distortions and spin, to produce solid evidence of their allegations.”

The review, to start within six months, was proposed by the House of Lords as part of a raft of amendments to the Counter-Terrorism and Border Security Bill, which will proceed to royal assent without a Commons vote.

Some campaign groups have accused Prevent of targeting Muslims and setting the barrier for intervention too low, with cases including a boy reported for mispronouncing “cucumber” and “cooker bomb” drawing criticism.

But Mr Wallace provided statistics on referrals, which show a 36 per cent rise in the number of suspected far-right extremists, as proof that Prevent “is not about singling out any particular group or ideology but is similar to other forms of safeguarding, carried out every day by social workers, teachers and police”.

David Cameron introduced legal requirements for institutions including schools, the NHS and councils to report suspected extremists to Prevent four years ago, sparking fresh accusations of state-sanctioned spying.

The government later refused calls for change from the Home Affairs Committee, Independent Reviewer of Terrorism Legislation, Joint Committee on Human Rights, MPs and charities.

As recently as last month, Sajid Javid was defending Prevent and said some of its critics were “on the side of extremists”, while the head of UK counterterror policing called the programme the “most important pillar” of a national strategy against extremism.

The government said that, since 2012, more than 1,200 people have been given tailored mentoring through “Channel intervention providers” after being flagged to Prevent.

In 2017-18, more than 7,300 referrals were made but 42 per cent resulted in no action being taken. People receiving Channel support were evenly split between Islamists and the far-right.

Participation in both the Prevent and Channel programmes is voluntary, and some officials have questioned whether the process should be obligatory after terrorists slipped through the net.

The teenage asylum seeker who attempted to bomb a Tube train at Parsons Green station last September had been referred to Prevent, as had a man who plotted to bomb Downing Street and behead Theresa May.

Terror attack at Parson's Green – in pictures Show all 23 1 /23 Terror attack at Parson's Green – in pictures Terror attack at Parson's Green – in pictures Parsons Green explosion A bucket with flames and wires coming out of it was photographed in the carriage after the explosion – apparently the source of the blast AFP Terror attack at Parson's Green – in pictures Parsons Green explosion An explosion on a packed Tube train has injured a number of people in west London AFP/Getty Terror attack at Parson's Green – in pictures Parsons Green explosion The blast triggered a stampede as commuters panicked AFP/Getty Terror attack at Parson's Green – in pictures Parsons Green explosion Click through for more pictures from the scene Reuters Terror attack at Parson's Green – in pictures Parsons Green explosioN A police officer and a sniffer dog stand in the street near Parsons Green tube station in London, Britain September 15, 2017. REUTERS/Kevin Coombs Reuters Terror attack at Parson's Green – in pictures Parsons Green explosion Handout photo issued by James Treen of emergency services attending an incident at Parsons Green station in west London amid reports of an explosion. PRESS ASSOCIATION Photo. Issue date: Friday September 15, 2017. See PA story TRANSPORT Explosion. Photo credit should read: James Treen/PA Wire NOTE TO EDITORS: This handout photo may only be used in for editorial reporting purposes for the contemporaneous illustration of events, things or the people in the image or facts mentioned in the caption. Reuse of the picture may require further permission from the copyright holder. PA Terror attack at Parson's Green – in pictures Parsons Green explosion Police vehicles line the street near Parsons Green tube station in London, Britain September 15, 2017. REUTERS/Kevin Coombs Reuters Terror attack at Parson's Green – in pictures Parsons Green explosion A police officer stands outside Parsons Green tube station in London, Britain September 15, 2017. REUTERS/Kevin Coombs Reuters Terror attack at Parson's Green – in pictures Parsons Green explosion Armed British police officers stand on duty outside Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. A Metro.co.uk reporter at the scene was quoted by the paper as saying that a white container exploded on the train and passengers had suffered facial burns. / AFP PHOTO / Daniel LEAL-OLIVAS / ===RESTRICTED TO EDITORIAL USE - MANDATORY CREDIT "AFP PHOTO / HO / @RRIGS - NO MARKETING NO ADVERTISING CAMPAIGNS NO ARCHIVES - DISTRIBUTED AS A SERVICE TO CLIENTS FROM FROM ALTERNATIVE SOURCES, THEREFORE AFP IS NOT RESPONSIBLE FOR ANY DIGITAL ALTERATIONS TO THE PICTURE'S EDITORIAL CONTENT, DATE AND LOCATION WHICH CANNOT BE INDEPENDENTLY VERIFIED == / DANIEL LEAL-OLIVAS/AFP/Getty Images AFP/Getty Terror attack at Parson's Green – in pictures Parsons Green explosion Emergency services attend the scene following a blast on an underground train at Parsons Green tube station in West London, Britain September 15, 2017, in this image taken from social media. TWITTER / @ASolopovas/via REUTERS THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY. NO RESALES. NO ARCHIVES. MANDATORY CREDIT Reuters Terror attack at Parson's Green – in pictures Parsons Green explosion Armed British police officers stand on duty outside Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. A Metro.co.uk reporter at the scene was quoted by the paper as saying that a white container exploded on the train and passengers had suffered facial burns. / AFP PHOTO / Daniel LEAL-OLIVAS / ===RESTRICTED TO EDITORIAL USE - MANDATORY CREDIT "AFP PHOTO / HO / @RRIGS - NO MARKETING NO ADVERTISING CAMPAIGNS NO ARCHIVES - DISTRIBUTED AS A SERVICE TO CLIENTS FROM FROM ALTERNATIVE SOURCES, THEREFORE AFP IS NOT RESPONSIBLE FOR ANY DIGITAL ALTERATIONS TO THE PICTURE'S EDITORIAL CONTENT, DATE AND LOCATION WHICH CANNOT BE INDEPENDENTLY VERIFIED == / DANIEL LEAL-OLIVAS/AFP/Getty Images AFP/Getty Terror attack at Parson's Green – in pictures Parsons Green explosion Armed British police officers stand on duty outside Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. A Metro.co.uk reporter at the scene was quoted by the paper as saying that a white container exploded on the train and passengers had suffered facial burns. / AFP PHOTO / Daniel LEAL-OLIVAS / ===RESTRICTED TO EDITORIAL USE - MANDATORY CREDIT "AFP PHOTO / HO / @RRIGS - NO MARKETING NO ADVERTISING CAMPAIGNS NO ARCHIVES - DISTRIBUTED AS A SERVICE TO CLIENTS FROM FROM ALTERNATIVE SOURCES, THEREFORE AFP IS NOT RESPONSIBLE FOR ANY DIGITAL ALTERATIONS TO THE PICTURE'S EDITORIAL CONTENT, DATE AND LOCATION WHICH CANNOT BE INDEPENDENTLY VERIFIED == / DANIEL LEAL-OLIVAS/AFP/Getty Images AFP/Getty Terror attack at Parson's Green – in pictures Parsons Green explosion Armed policemen stand by cordon near Parsons Green tube station in London, Britain September 15, 2017. REUTERS/Hannah McKay Reuters Terror attack at Parson's Green – in pictures Parsons Green explosion A woman reacts outside Parsons Green tube station in London, Britain September 15, 2017. REUTERS/Kevin Coombs Reuters Terror attack at Parson's Green – in pictures LONDON, ENGLAND - SEPTEMBER 15: Emergency services outside of Parsons Green Underground Station on September 15, 2017 in London, England. Several people have been injured after an explosion on a tube train in south-west London. The Police are treating the incident as terrorism. (Photo by Jack Taylor/Getty Images) Getty Terror attack at Parson's Green – in pictures LONDON, ENGLAND - SEPTEMBER 15: A fireman walks past the police cordon at Parsons Green Underground Station on September 15, 2017 in London, England. Several people have been injured after an explosion on a tube train in south-west London. The Police are treating the incident as terrorism. (Photo by Jack Taylor/Getty Images) Getty Terror attack at Parson's Green – in pictures LONDON, ENGLAND - SEPTEMBER 15: A tube train is seen stopped at Parsons Green Underground Station on September 15, 2017 in London, England. Several people have been injured after an explosion on a tube train in south-west London. The Police are treating the incident as terrorism. (Photo by Chris J Ratcliffe/Getty Images) Getty Terror attack at Parson's Green – in pictures LONDON, ENGLAND - SEPTEMBER 15: Police officers stand by a cordon at Parsons Green Underground Station on September 15, 2017 in London, England. Several people have been injured after an explosion on a tube train in south-west London. The Police are treating the incident as terrorism. (Photo by Jack Taylor/Getty Images) Getty Terror attack at Parson's Green – in pictures Police forensics officers works alongside an underground tube train at a platform at Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. "We are aware of an incident at Parsons Green tube station. Officers are in attendance," London's Metropolitan Police said on Twitter. / AFP PHOTO / Daniel LEAL-OLIVAS / (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images) AFP/Getty Terror attack at Parson's Green – in pictures LONDON, ENGLAND - SEPTEMBER 15: Emergency serivces attend to the scene near Parsons Green Underground Station on September 15, 2017 in London, England. Several people have been injured after an explosion on a tube train in south-west London. The Police are treating the incident as terrorism. (Photo by Jack Taylor/Getty Images) Getty Terror attack at Parson's Green – in pictures Members of the emergency services work outside Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. British police are treating an incident on a London Underground train on Friday as an act of terrorism, saying "a number of people" had been injured. "Terrorist incident declared at Parsons Green Underground Station," police said in a statement. / AFP PHOTO / Daniel LEAL-OLIVAS (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images) AFP/Getty Terror attack at Parson's Green – in pictures Armed British police officers walk through the carriage of a London underground tube carriage at Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. A Metro.co.uk reporter at the scene was quoted by the paper as saying that a white container exploded on the train and passengers had suffered facial burns. / AFP PHOTO / Daniel LEAL-OLIVAS (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images) AFP/Getty Terror attack at Parson's Green – in pictures Members of the emergency services and armed police officers work alongside an underground tube train at a platform at Parsons Green underground tube station in west London on September 15, 2017, following an incident on an underground tube carriage at the station. Police and ambulance services said they were responding to an "incident" at Parsons Green underground station in west London on Friday, following media reports of an explosion. "We are aware of an incident at Parsons Green tube station. Officers are in attendance," London's Metropolitan Police said on Twitter. / AFP PHOTO / Daniel LEAL-OLIVAS (Photo credit should read DANIEL LEAL-OLIVAS/AFP/Getty Images) AFP/Getty

The government accepted several other amendments to the Counter-Terrorism and Border Security Bill, watering down a controversial new law that will see people jailed for up to 10 years for entering “designated areas” abroad.

Aid workers told the government it was too broad and could criminalise British citizens working in conflict zones.

The amendments create exceptions for people who remain in newly designated areas involuntarily, or for listed purposes including humanitarian aid, journalism, working for a government, tnational military or United Nations, court appearances, funerals or visiting a terminally ill relative.

The law was drawn up to target Isis fighters and other terrorists who have proven difficult to prosecute under current British laws.

The Independent understands that areas considered for prohibition are likely to overlap with those where the government already warns against all travel, which currently includes the whole of Syria, Yemen, Libya, parts of Iraq and other warzones.

Bond, a network of UK international development organisations, said the amendments were an “important win” for the humanitarian sector.

Policy manager Rowan Popplewell said: “Aid and humanitarian actors are now finally exempt and no longer have to fear being charged with a criminal offence for simply trying to do their jobs.”

But MP John Woodcock accused the government of “endorsing loopholes” that could allow terrorists to travel to conflicts.

Aid workers raised fears they would be criminalised by the law (AFP/Getty)

He told the Commons the list of reasonable excuses could be “exploited” by deception, but Mr Wallace said people committing terror offences would still be detected.

“We are not in the business of drawing a circle around somewhere and saying no one is allowed in,” Mr Wallace added. “That said, someone would have to have a reasonable excuse and present it so that it can be tested and investigated.”

The changes accepted by the government fall short of 29 amendments put forward by the Joint Committee on Human Rights, which called for a clause making accessing terrorist material online a criminal offence punishable by up to 15 years in prison to be scrapped.

The United Nations special rapporteur on the right to privacy has accused the government of straying towards “thought crime”, and Max Hill QC, the former independent reviewer of terrorism legislation, found it “difficult to countenance”.

Lords amendments inserted protections for journalism and academic research.