Police in Madrid have arrested three Moroccans including an 'extremely dangerous ISIS member' just days before two million people arrive in the city for the Gay Pride festival.

The 32-year-old man was described as being in an 'advanced state of radicalisation' and likened to terrorists behind recent attacks in the UK and France.

Two other suspects he shared a flat with near to Madrid's Atocha train station, one aged 38 and the other aged 33, were also held in dawn raids on Wednesday.

Police in Madrid have arrested three Moroccans including an 'extremely dangerous ISIS member' just days before two million people arrive in the city for the Gay Pride festival

More than 200 suspected jihadists have been arrested in Spain since the start of 2015

Madrid's famous Gay Pride festival will be held from Friday 23 June to Sunday 2 July.

A spokesman for Spain's National Police, referring to ISIS by its acronym DAESH, said: 'Officers have arrested a 32-year-old Moroccan man living in Madrid who belonged to the terrorist organisation DAESH and was in an advanced state of radicalisation.

'He had an extremely dangerous profile, coinciding with those of the terrorists recently involved in attacks in the United Kingdom and France, and was considered an obvious threat to national security.

'The suspect had carried out an exhaustive study and search for official DAESH training material.

Two other suspects he shared a flat with near to Madrid's Atocha train station, one aged 38 and the other aged 33, were also held in dawn raids on Wednesday

A spokesman for Spain's National Police, referring to ISIS by its acronym DAESH, said: 'Officers have arrested a 32-year-old Moroccan man living in Madrid who belonged to the terrorist organisation DAESH and was in an advanced state of radicalisation'

The spokesman added: 'The suspect had carried out an exhaustive study and search for official DAESH training material'

The force added in a statement: 'During the investigation, it has been possible to detect different markers on social media that link this man to ISIS members in Syrian-Iraqi war zones'

'He had compiled an abundant amount of jihadist terror manuals such as a suicide bomber manual or an Electronic Jihad manual.

'The subjects covered by these documents range from ideological preparation through to acts of martyrdom.

'There are other manuals that the police are analysing at the moment.'

The force added in a statement: 'During the investigation, it has been possible to detect different markers on social media that link this man to ISIS members in Syrian-Iraqi war zones.

Madrid's famous Gay Pride festival will be held from Friday 23 June to Sunday 2 July. Pictured, revellers during Madrid's Gay Pride festival last year

More than two million people are expected to turn out for Madrid's Gay Pride parade. Pictured, parade goes in Madrid in 2016

'He was also trying to recruit people in his close circle so he could convince them to wage violent jihad in our country.'

Police say they suspect he could have been training the other two suspects to commit terrorist acts.

More than 200 suspected jihadists have been arrested in Spain since the start of 2015 - 172 of them since it raised its anti-terror alert level to four on a scale of five on June 26 2015.