La Balma de la Margineda, found by archaeologists at Sant Julià de Lòria, was settled in 9,500 BC as a passing place between the two sides of the Pyrenees. The seasonal camp was perfectly located for hunting and fishing by the groups of hunter-gatherers from Ariege and Segre.