Alcázar (Spanish) comes from Arabic al-qaṣr (الْقَصْر) — "the palace" or "the fortress," itself from Latin castrum (fort).
In Spain, alcázar denotes a royal palace or fortified residence, often named for its city:
Alcázares (Spanish) / alcazars (anglicized).
The word traces the layers of Iberian history: Roman fort → Islamic citadel → Christian royal palace.