Police in Madrid have arrested a Moroccan man who broke into a school shouting Allahu Akbar and threatening to slaughter children 'like lambs.'

Police said the 46-year-old was carrying a bottle thought at first to contain poison, although it was later found to be empty.

He is said to have sparked panic after managing to get into a classroom where there were three-year-old children.

A 46-year-old Moroccan man has been arrested after he broke into a classroom filled with three-year-old children at this school in Madrid and threatened to kill them

A caretaker held him with help from other staff before police reached the scene.

The ugly incident happened just after 9am last Friday at state school Gonzalo Fernandez de Cordoba in Madrid's popular La Latina neighbourhood, El Mundo said.

The man is understood to have been arrested for breaking and entering, criminal damage and threats.

Local reports said the suspect had no links to the school and parents were trying to put the scare behind them after the 'tremendous shock.'

A police source said: 'He was unarmed and is believed to have been suffering from mental health problems.

'No-one was injured but it was obviously a very frightening episode for the school.'

News of the incident emerged as police in the eastern city of Valencia arrested a 47-year-old man accused of belonging to terror group ISIS.

Interior Ministry officials described him as a 'powerful instigator capable of creating the ideal breeding ground for the idea of committing terrorist attacks to crystallise in the minds of new recruits.'

The illegal immigrant, who has not been named, was also said to be the main person responsible for recruiting and sending a 26-year-old Moroccan suicide bomber to Iraq in November 2014 who killed 33 Iraqi soldiers and injured dozens more in an attack a month and a half after he reached the country.

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