Until the 15th century, the town's centre was located one kilometre ( 1.0 kilometers ) inland, next to the Chapel of Les Alegries (the town's main church before the Church of Sant Romà was built) to protect itself from attacks from English, French, Turkish and Algerian pirates.