The Castelo de São Jorge is part of an extensive and ancient defensive system which stands imposingly atop a hill overlooking the Tagus River.
It is possible that pre-Roman Lisbon was protected by a wall (as many other Iron Age settlements in the west of the peninsular were), but no real evidence for this has thus far been found.
The oldest defensive walls identified in Lisbon date back to the Roman period and suggest a city that stretched from the top of the hill down to the riverside. It appears that it was limited to the west by the tidal creek of the baixa area and to the east by a topography of very steep slopes.
Although we have a relatively good understanding of the layout of these walls (from the Imperial period and later) to the east and the south, their northern limit, in the area where the castle is located, remains unknown
As such, we know that part of the Islamic wall lies within the perimeter of the national monument, specifically the wall of the alcaçova (casbah or citadel). At the time, this is the area where the political, military and religious elites would have resided.
The first known written record about this fortification dates back to 985 AD. It comes in the form of an Arabic epigraph which testifies to the repairing of the city wall during the time of Hišām II, under the patronage of the famous governor of the Al-Andaluz and great military man, Almançor.
This epigraph (a Roman stele reused in the Islamic period) was found in 1939 between two towers in the western area of Castelo de S. Jorge and is on display in the Museu da Cidade.
It was likely built into the wall or over a doorway.
The construction works documented in the epigraph, as well as the descriptions of geographers and reports of 12th-century crusaders, confirm that this was a walled city which extended down to the river, with a citadel positioned at the very top of the hill and encircled by walls.
This fortress was conquered by Afonso Henriques, the first king of Portugal, in 1147.