 Several hypotheses have been raised as to its name, which may be linked to "Athanase" (Athanasius) or, more doubtfully, to "Athena".The present basilica of Saint-Martin d'Ainay was previously the monastic church of Ainay Abbey.A rampart was built between 1313 and 1324 to protect the abbey's lands at the request of abbot Jean II de la Palud.