In the Alcazaba's Segundo Recinto you’ll find the ruins of the Muslim rulers’ palace, built by the taifa ruler Almotacín (r 1051–91), under whom medieval Almería reached its peak. Also within this compound is a pair of reconstructed medieval houses, containing archaeological exhibits, and a chapel, the Ermita de San Juan, that was originally a mosque.