Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An ISIS-linked group that was committed to carrying out a jihadist attack in Madrid was broken up on Tuesday, Spanish police said.

Three Moroccan nationals were arrested in early-morning raids in Madrid and Rivas-Vaciamadrid.

Police guard the home of a man suspected to be a member of a group linked to ISIS in Madrid, Tuesday. STRINGER / Reuters

“The terrorists were extremely radicalized and had assumed terrorist discipline and ideology completely," national police said in a statement released by Spain's interior ministry. "They were perfectly organized and [worked within a] hierarchy and each one of the components had a determined role.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

When it was broken up, the group’s members were “totally radicalized" and committed to "terrorist ideology … showing their total willingness to carrying out an attempt in the city of Madrid.”

The statement added that the group was primarily using the Internet and social media to spread its message.

The arrested trio was fully willing to “carry out terrorist acts,” it said, adding that the leader of the cell recruited others by spreading ISIS doctrine and "terrorist discipline.”

The other two members were “operatives” in charge of carrying out potential terrorist acts.

Spain has seen a number of north African terror cells in recent years, including one convicted the 2004 Madrid station bombing that killed 191 people.