London mayor Sadiq Khan has ordered a “comprehensive overhaul” of a controversial police database that has been accused of racial discrimination and stigmatising children.

Scotland Yard’s “gangs matrix” was set up after the 2011 London riots and holds the details of up to 4,000 individuals at any one time. Some are as young as 12.

The so-called gang nominal are subjected to coded levels of police activity, which can range from efforts to divert them away from criminality to surveillance, arrests and court orders.

Mr Khan published a review that found that three quarters of those on the matrix were under the age of 25, 80 per cent were black. Many had a zero-harm score – reflecting the lowest risk of committing violence.

“The representation of young black men on the matrix is disproportionate to their likelihood of either causing or being a victim of gang violence and communities have deep reservations about how it operates,” it warned. “Further investigation is to be carried out to understand if this disproportionality is legitimate and to be transparent about this process.”

The Mayor’s Office review recommended that a “comprehensive overhaul of the matrix operating model both to restore trust and also to bring it into line with data protection legislation”.

It criticised a lack of transparency by London's Metropolitan Police over how the system works, and suggested that inconsistency in the way it was used have led to serious breaches of data protection laws.

The Mayor’s Office told the force to implement nine recommendations to ensure the database is used lawfully and with no unjustifiable disproportionality, with stronger processes, oversight and transparency.

Recommendations included annual reviews of the subjects on the matrix, an appraisal of those with a “zero harm” score, removal of people not meeting strict criteria, data processing improvements and police engagement with the Equality and Human Rights Commission.

It ordered changes to take place by the end of 2019.

Scotland Yard has argued that the matrix helps combat violence and make London safer and said that the 7,000 people who appeared on the matrix in a five-year period, 96 per cent have been sanctioned for a criminal offence, including 79 per cent for violence, weapons or robbery.

The review recognised that a gangs matrix was a “necessary law enforcement tool” for reducing violent crime in London.

It said gangs were a “driving force” behind some of the most serious violence in London, amid rising stabbings and shooting nationwide.

“The harm of gangs extends further, beyond serious street violence and encompassing other serious issues including violence against women and girls, acquisitive crime and drug supply,” it added. “Those preyed upon by gangs are amongst the most vulnerable children and young people in our city, often from deprived, crime-affected backgrounds and presenting multiple, complex needs such as mental illness.”

Individuals spend an average of two years and four months on the matrix on average, but the review found it appears to have a positive impact on reducing levels of offending and victimisation.

Data on arrests and stop and search indicates that levels of police attention fall after people are removed from the matrix and legal advice said it can be used legally, the review said.

But it also found action must be taken to be fully compliant with the law, including an equalities impact assessment and changes to data handling.

The teenagers murdered in London in 2018 Show all 21 1 /21 The teenagers murdered in London in 2018 The teenagers murdered in London in 2018 Oluwadamilolda Odeyingbo Oluwadamilolda Odeyingbo, 18, was killed in a fight in Chislehurst on 10 January 2018 Metropolitan Police The teenagers murdered in London in 2018 Hasan Ozcan Hasan Ozcan, 19, was stabbed to death on the Gascoigne Estate in Barking on 3 February 2018 Metropolitan Police The teenagers murdered in London in 2018 Sabri Chibani Sabri Chibani, 19, was stabbed fatally in the chest in Streatham on 11 February 2018 Metropolitan Police The teenagers murdered in London in 2018 Promise Nkenda Lord Promise Nkenda, 17, was stabbed to death in Canning Town on 14 February 2018 Facebook The teenagers murdered in London in 2018 Lewis Blackman Lewis Blackman, a 19-year-old rapper from Kentish Town, was stabbed to death in Kensington on 18 February 2018 Metropolitan Police The teenagers murdered in London in 2018 Abdikarim Hassan Abdikarim Hassan, 17, was stabbed to death near his home in Camden's Peckwater estate on 20 March - less tahan two hours before another man was stabbed to death nearby Metropolitan Police The teenagers murdered in London in 2018 Kelvin Odunuyi Kelvin Odunuyi, a 19-year-old rapper known as DipDat and Lampz, was shot dead in Wood Green on 8 March Metropolitan Police The teenagers murdered in London in 2018 Lyndon Davis Lyndon Davis, 18, was chased down and stabbed to death in Chadwell Heath on 14 March Metropolitan Police The teenagers murdered in London in 2018 Tanesha Melbourne-Blake Tanesha Melbourne, 17, was killed in a drive-by shooting in Tottenham on 2 April PA The teenagers murdered in London in 2018 Amaan Shakoor Amaan Shakoor, 16, was shot dead in Walthamstow on 2 April Metropolitan Police The teenagers murdered in London in 2018 Israel Ogunsola Israel Ogunsola, 18, was stabbed to death in Hackney on 4 April Metropolitan Police The teenagers murdered in London in 2018 Rhyhiem Ainsworth Barton Rhyhiem Ainsworth Barton, a 17-year-old rapper and aspiring architect, was shot dead in a Kennington Street on 5 May Handout The teenagers murdered in London in 2018 Jordan Douherty Aspiring rapper Jordan Douherty died of his injuries outside a birthday party in Romford on 23 June Metropolitan Police The teenagers murdered in London in 2018 Katrina Makunova Katrina Makunova, 17, was stabbed to death in Camberwell on 12 July 2018 Metropolitan Police The teenagers murdered in London in 2018 Latwaan Griffiths 18-year-old Latwaan Griffiths was fatally stabbed on 25 July and died in hospital after being thrown off the back of a moped in Camberwell Metropolitan Police The teenagers murdered in London in 2018 Guled Farah Guled Farah, 19, was shot in Walthamstow on 22 September Metropolitan Police The teenagers murdered in London in 2018 Ethan Nedd-Bruce Ethan Nedd-Bruce, 18, died after he was shot outside a party at a flat in Greenwich, south-east London, on 22 October. He had also been stabbed, but the gunshot wound was the cause of death. Metropolitan Police The teenagers murdered in London in 2018 Jay Hughes Jay Hughes, 15, died was fatally stabbed outside a chicken shop in Bellingham, south-east London, on 1 November Metropolitan Police The teenagers murdered in London in 2018 Malcolm Mide-Madariola Malcolm Mide-Madariola, 17, was found suffering from a stab wound outside Clapham South Tube station on 2 November Metropolitan Police The teenagers murdered in London in 2018 John Ogunjobi John Ogunjobi, 16, died in front of his parents after he was stabbed in Greenleaf Close, Tulse Hill, on 5 November Metropolitan Police The teenagers murdered in London in 2018 Aron Warren Aron Warren, 18, was found stabbed in a flat block in Greenwich on 8 December and died at the scene Metropolitan Police

Mr Khan, said: “The review has shown that the gangs matrix can be an effective enforcement tool and is helping to tackle violence on our streets. But to many Londoners, the way it is applied and enforced is a cause for concern and it needs to be comprehensively overhauled to ensure it is used lawfully and proportionately.

“By implementing the review’s nine recommendations, the matrix can address the serious breaches of data protection laws and ensure only those at genuine risk of causing or being a victim of violence are included. It’s important these recommendations are carried out quickly and transparently.”

The mayor’s report is the latest blow to the controversial system, following breaches found by the Information Commissioner’s Office and allegations that it is both racially discriminatory and ineffective.

A recent report by rights group Amnesty UK found a “chaotic and inconsistent” approach to adding individuals to the matrix between different London boroughs, and said some officers were using social media activity and links to grime music as indicators of gang links.

Support free-thinking journalism and attend Independent events

“It’s a conflation of elements of youth culture with violent offending and that’s heavily racialised,” Amnesty director Kate Allen told The Independent. “It’s difficult to know how people come off the matrix and whether that is effective policing or not.”

Last month, the information commissioner found the matrix had breached data protection laws.

An investigation concluded that police were failing to distinguish between the approach to victims and perpetrators of gang-related crime, and sharing information with authorities including councils, schools and housing associations.

It said some London boroughs were using additional informal lists of people who had been removed from the matrix – despite having no intelligence they were gang members.

Elizabeth Denham, the information commissioner, said: “Simply being on this database could lead to denial of services and other adverse consequences.”

A spokesperson for the Metropolitan Police said the force has accepted the recommendations but does not believe the matrix “directly discriminates against any community and that it reflects the disproportionality of violent offenders and victims”.

A statement from the force added: “We are committed to reducing the disproportionate number of young black men who are victims of gang crime. London and the UK as a whole has experienced an increase in serious violence this year and a significant proportion of this has been attributable to young men in gangs as both offenders and victims.