La Almudaina Palace was the seat of the independent kingdom of Majorca during the reigns of Jaime I, Sancho I and Jaime II, until it became part of the kingdom of Aragon under Pedro IV. The castle visible today is the result of modifications to the Muslim fortress constructed from 1281.
http://www.spain.info/en_IN/que-quieres/arte/monumentos/mallorca/palacio_real_de_la_almudaina.html