With the Muslim conquest of the Peninsula, the Medieval Barcelona it was also occupied, being known henceforth by the name of Barshilūnan (between 718 and 801). But in the year 801 the King of the Franks, Ludovico Pío, integrated it into the Carolingian kingdom and appointed a local nobleman as Count of Barcelona, subject to his person. Throughout the 9th and 10th centuries, Muslim incursions were constant and in some cases they came to take and plunder the town, although, lacking the ambition to control the territory, they did not return to occupy it permanently. For their part, the Carolingians either did not want to or could not help the city in these difficult times. The straw that broke the camel's back was the attack on Almanzor , in the year 985, which culminated in the looting and systematic destruction of the city (see "The day Barcelona is going to die. The campaign against the Catalan counties" in Desperta Ferro Antigua y medieval No. 52:Almanzor ), as well as the transfer of its inhabitants as prisoners to al-Ándalus . From that moment on, the Count of Barcelona refused to surrender any vassalage to the Frankish kings and inaugurated a period of relative independence for the Catalan counties.
A powerful walled enclosure, inherited from Roman times (erected between the second half of the 3rd century AD, after the Frankish invasions, and the beginning of the 4th century AD. ), defended medieval Barcelona, the most important city of the Catalan counties. The wall canvas, with an approximately rectangular perimeter, was marked out with no less than 76 stone towers, and was provided with four entrances (doors praetoria , decumana , principalis sinistra and principalis dextra ) equally fortified, one on each side.
The interior plant of medieval Barcelona it reproduced, to a large extent, the one already traced by the Roman city (the ancient Barcino). As in all Roman cities, two great arteries stood out, the cardo and the decumanus, although in this case they were not oriented north-south and east-west as was customary, but rather displaced with respect to the cardinal axes. These two roads still exist today in the pair of Carrer del Bisbe and Carrer de la Ciutat streets, on the one hand (in a northwest-southeast direction, which form the old decumano), and the pair formed by Carrer de Ferran and Jaume I, on the other (in a southwest-northeast direction, following the old cardo). These four streets fit into the modern Plaça de Sant Jaume , at that time occupied by the primitive church of Sant Jaume, which formed the center of the city both in Roman and medieval times. To the north of the current location of the same was erected, in Roman times, the space of the forum and temple of Augustus. Already in late Roman times a Christian temple (Sant Just) would be erected, to the east of the current Plaça de Sant Jaume. But the main temple of the city was, without a doubt, the early Christian basilica (5th-7th centuries) dedicated to the Holy Cross (Sanctae Crucis ), and which occupied the space of Plaça de Sant Iu (in front of the Marés Museum) and Carrer dels Comtes; the baptistery is located under the Palau Reial Major and is accessed from the City History Museum. It had three parallel naves and, next to it, the episcopal seat was erected. Both one and the other were completely destroyed by the hosts of Almanzor, and served as a distant precedent for the Gothic cathedral that we can see today in the same area, although not exactly on the ruins of the previous ones (La Seu).
Already outside the urban area we find some neighborhoods built around Christian temples. Such is the case of the 7th century church of Santa Maria del Mar (not to be confused with the current basilica, dating from the 14th century), next to the coast, whose associated neighborhood was closely linked to port activity. To the north of the city we find the neighborhood of Sant Pere de les Puel les, around the church of the same name (consecrated in 945).