Why does the word ‘Andalucía’ have an accent?

The last syllable has an accent if it ends in -n or -s, but Andalucía ends in an -a.