The name Alhambra has its origins in an Arabic word meaning "red castle or vermilion", perhaps due to the color tone of the towers and walls that completely surround the hill of La Sabica, which under the light of the stars is Of silver color, but in the light of the sun acquires a golden tone. Although there is a more poetic explanation, narrated by the Muslim chroniclers who talk about the construction of the Alhambra "under the light of the torches." Created originally for military purposes, the Alhambra was a fortress, a palace and a small medina, all at the same time. This triple character helps us understand the many characteristics of this monument.
(https://www.alhambra.org/en/alhambra-history.html)