A major terror attack by the Islamic State (Isis) terrorist group was foiled in Spain after the security forces arrested three radicalised jihadis in the early hours of Tuesday, local reports said.

The Spanish interior ministry said that the three arrested men were Moroccans based in Madrid and were planning an immediate attack.

Local reports described the arrested Isis supporters as "extremely radicalised" and "perfectly organised."

Each of the three Isis members had a defined role tasked according to their hierarchy in the organisation, the reports said. The suspects were in the age range of 26 to 29.

It is being reported that the security forces feared that the attack was immediate and carried out the arrests with urgency as the suspects were "unpredictable...displayed signs of extreme risk and were willing to take any action to carry out the attacks, the interior ministry said.

According to El Pais, the authorities sprang into action after hearing a conversation between the three Isis supporters in which they said they had "to act in Spain now" without specifying any details.

In October, Spain imprisoned 81 people - 69 men and 12 women, for links with the Isis terror group. According to EFE, the average age those imprisoned was between 19 and 35 years.