Montjuïc Castle was built to control Barcelona rather than to defend it, and it did that job for three hundred years. The hill commands the city and the port together, and whoever held the fort could shell either. Today it is a quiet place of dry ditches, sloping ramparts and grass, with the container port working directly below on one side and the whole plain of Barcelona on the other. Almost nothing of it shows from the city, because it was built not to be hit.
The fortress took its present shape after 1751, when the military engineer Juan Martín Cermeño pulled down the older fort, cut the dry moat and laid out the four bastions and the outworks. Its twentieth century is why most people come: courts martial sat here and prisoners were shot in the moat. The army held the hill long after it had any military use and gave it up to the city only in 2007, a handover the city celebrated in public with tens of thousands of people walking up.