Introduction
At an uncertain point in the 4th century, when the Roman Empire introduced a new defensive policy based on fortifying cities, roads and communication hubs and strengthening highly effective mobile armies, a castle was built in Sant Julià de Ramis, taking advantage of the site's excellent location and its close, direct connection to Girona.
This fortification, which controlled and defended the public road, passed into Visigoth hands when the Western Roman Empire fell. Around the year 500, the building underwent substantial alterations. Old structures were demolished and new ones erected, without changing the purpose of the fortress: to keep open the road linking the Iberian Peninsula to the rest of the continent.