Raid of 897

The Raid of 897 (الغزو سنة ٢٨٤, Al-Ġazw sana 284; in Catalan, Ràtzia de 897) was a military campaign (غزو, ġazw) of the Emirate of Cordova against the County of Barcelona.

Background
Between 883 and 884, the Muslims of the Upper March (الثغر الأعلى, Aṯ-Ṯaḡr al-Aʿlà) felt menaced by the expansion of the count of Barcelona, Wilfred the Hairy, who began to make efforts to relocate the frontier line between the rivers Lubricatus and Siqr, by establishing defensive positions at the present-day shires of the Bages (the Castle of Cardona, for example), Osona, Berguedà and the Lordensi valley (as well as some apprisones at the Valley of Cervelló, below the river Lubricatus), and repopulating those areas; building and consolidating there churches and abbeys, at whose surroundings the repopulating settlements were established.

Wilfred fought to stabilize the frontier line from the Castle of Cardona towards the present-day shire of Solsona. By that time, the County of Barcelona's frontier line passed through to the north of the shire of Solsona, probably through Besora, Tentellatge and Correà; the frontier line of Berga passed through Sorba, Gargallà and Serrateix; and that of Osona passed through Cardona, Manresa and the mountains of Montserrat. Because of all this, the madīnah of Larida was fortified; but Wilfred saw it as a provocation and attacked the city, by that time governed by the walī Isma'il ibn Musa, of the Banu Qasi dynasty. The attack against Larida did not succeed. Muslim historian Ibn al-Athir narrates that the Muslims inflicted many casualties among the attackers.

A successor to Isma'il, Lubb ibn Muhammad, became engaged in an incessant combat against the walī of Washka, Muhammad al-Tawil, as well as against Christian nobles from the Aragonese and Catalan counties, that were slowly expanding down to the south and repopulating the areas at the south of the Pyrenees. Christian and Muslim raids and counter-raids in enemy territory occurred quite often. In this context, Lubb ordered the fortification of several towns, such as Larida; constructing its As-Sudd (السد) or Al-Qaṣabah (القصبة), also called "Castell del Rei" some time after the Christian conquest; Munt sun or Balagî; constructing its famous Ḥiṣn Balagî or "Castell Formós". He also ordered the construction of the main mosque (مسجد الجامع, Masjid al-Jāmiʿ) of Larida, on the grounds of the modern-day Seu Vella.

Muslim raid
In 897, after the retreat of Muhammad al-Tawil's forces, Lubb ibn Muhammad attacked the County of Barcelona. Eudes, King of Western Francia, who was busy confronting many troubles in the interior of the kingdom, as well as the Viking invasions, could not send any reinforcement to the Catalan counts, who had to confront the Muslim offensive by themselves alone.

On 11 August 897, count Wilfred the Hairy was killed in action near the Castle of Aura; which had previously been, according to the Muslim historian Ibn Hayyan, seized and burnt to the ground by Lubb's army. Thus provoking the mass evacuations of the populations of Barcelona and Vallès, that went to take then refuge in the fortified places situated to the north of the Vallès and at the Bages, leaving their houses and lands deserted.

In the following year, Lubb's forces would be still fighting against the Franks, while in retreat.

Consequences
Wilfred the Hairy was succeeded by his son Wilfred II, and Barcelona was not seized by Lubb's army, so that its population could return to the city in early 898, but the Vallès area suffered greatly the ravagings of the raid, and remained almost completely deserted for twenty-five years.

Castle of Aura
The location of the castle of Aura, or castle of Oro, which was destroyed by Lubb ibn Muhammad's forces, and at whose vicinity Wilfred died; remains uncertain. It has been suggested that it may have been Valldaura (at the mountain range of Collserola), Valldora (at the present-day shire of the Solsonès), Besora, Santpedor (formerly Sant Pere d'Or) or Gualta, nearby Caldes de Montbui. According to Muslim sources, it was located "in the area of Barsaluna [Barcelona]" and was the residence of qumis [count] Anqadid ibn al-Mundhir [Wilfred the Hairy]. The etymology of Collserola's Valldaura comes from Vallis Laurea ("Valley of the bay leaves") and not from Vallis Aurea. The location of Gualta comes from a legend which mixes the events relating to the death of Wilfred, with the count Borrell II. The other locations are too far away from Barcelona.