São Jorge Castle is the one point where the whole shape of Lisbon is legible at once. From the outer terrace, Alfama's roofs fall away below towards the water, the Baixa's grid sits square in the middle distance, and the Tagus runs wide and silver with the bridge across it. Behind you, inside the walls, it is as much garden as fortress: olives and pines, peacocks with the run of the place, and an excavated site where the Alcáçova palace stood.
The walls you walk are largely Islamic-period work of the tenth and eleventh centuries, though the hill has been fortified since long before that. Lisbon was then ruled from Badajoz, one of the taifa kingdoms that divided Iberia. Afonso Henriques laid siege in 1147 and the defenders surrendered that October. What stands now is heavily reconstructed: towers and curtain wall were rebuilt in the twentieth century over what was left. The join is usually visible in the stone, with the old work small and irregular in rough courses and the rebuilt sections cut square and set level.