A week after the deadly attack in Barcelona, ISIS released a new propaganda video, saying it wants to restore al-Andalus to the Muslim world. Al-Andalus was the word for Muslim-ruled areas of Spain and Portugal in the Middle Ages.

The video mixes excerpts from news reports with music and statements from ISIS fighters speaking in Arabic and — for the first time — in Spanish.

One Spanish speaker in combat fatigues is saying, "With God's permission, al-Andalus will once again be the land of the caliphate."

Related: Why did ISIS target Spain? The answer may lie in history.

The Muslim invasion of Spain began at Gibraltar in 711 A.D., less than 80 years after the death of the Prophet Muhammad. In the preceding decades, Muslim armies had swept across North Africa, overthrowing or subduing Christian and pagan kingdoms and territories in their path.

Spain was no different, and Muslim emirs soon established control of what’s now Portugal and most of Spain, except for a few mountainous districts of the far north. Muslim armies then invaded France until famously checked at Poitiers in 732 A.D.

Al-Andalus in the year 750CE. Al-Andalus was the word for Muslim ruled areas of Spain and Portugal in the Middle Ages. Credit: Wiki Commons/"The Little Professor"

Generalizations are difficult, but once a territory had submitted to Muslim rule, its people were more or less allowed to continue to practice their faith. Non-Muslims were obliged to pay additional taxes and were treated as second-class citizens and often denied civil rights. Conversion was encouraged but not forced. Wholesale massacres and forced displacement were not widespread after the conquest.

This relative toleration allowed Christianity to survive and also encouraged significant immigration of Jewish people from elsewhere in the Mediterranean.

Local politics were often more important than faith, and Christian lords could serve Muslim emirs when their interests coincided, and vice versa.

Córdoba in southern Spain became the capital of its own state, initially an emirate, and then its own caliphate ruled by a family dynasty known as the Umayyads. The city thrived and became a locus of art, literature, architecture, science and culture, while the rest of Europe was struggling through what is popularly known as the Dark Ages. Much of the science and literature of ancient Rome was preserved thanks to the efforts of scholars in Córdoba, Seville and Granada.

For many Muslims, this era represents a golden age for Islam, with similar strides in civilization taking place in Baghdad, Damascus and Cairo at the same time.

It’s this golden age that ISIS is trying to re-create, says Rukmini Callimachi of The New York Times. “So, they often harken back to the old words that were used by the early Muslims for these territories.”

“It goes to this idea,” she adds, “that they are bringing back an old Islamic era, a golden age, and that they are going to restore the dignity of Muslims — at least in their eyes.”

For the Iberian Peninsula, that Muslim golden age was challenged by Christian kingdoms in the north aggressively seeking to gain ground, and then by internal differences. The Umayyad dynasty collapsed in 1031, and power eventually devolved to local emirs ruling smaller successor states.

This was the era of the crusades, and these smaller Muslim states were less able to contain their Christian rivals to the north.

Córdoba fell to the Christians in 1236, and by 1249 only the emirate of Granada remained.

Granada itself finally fell in 1492, the same year Christopher Columbus sailed to America for the first time. The 700-year struggle to fight Muslim rule is known in Spain as La Reconquista — "The Reconquest" — and is still commemorated in re-enactments and ceremonies, especially in the south.

Spanish promises of tolerance did not last long, and persecution of non-Catholics began the so-called Spanish Inquisition. That’s chiefly remembered in Europe and the West for the persecution of Jews, but Muslims were just as vulnerable.

Persecution took place at different times in different places, but in the early 1600s, the Spanish authorities implemented a policy of absolute intolerance. Arabic was banned. All Moriscos were ordered to be deported. Their property was sequestered.

Hundreds of thousands were expelled. But many remained, and many others returned. Oddly, slaves were not forced to convert.

Anyone found to be practicing a faith other than Catholic Christianity after that date faced the risk of torture, imprisonment and death. The last mass prosecution for “crypto-Muslim” practices was in 1727, although by that time sentences were not too severe.

These persecutions along with more recent ones around the world feature in ISIS and jihadi propaganda.

“They play that up so they can have a narrative of victimhood, which draws people to their cause,” says Callimachi.

The ISIS video threatening Spain has been met by a host of derisive memes and cartoons in Spanish social media.