La Alcazaba is Malaga's most important landmark, and overlooks the city from a hilltop inland. It is one of two Moorish fortresses in the city, the other being the Castillo de Gibralfaro, situated above. The Alcazaba is the best-preserved Moorish fortress palace in Spain. Constructed on the ruins of a Roman fortification during the reign of Abd-al-Rahman I, the first Emir of Cordoba, in around 756-780AD, the Alcazaba's original purpose was as a defence against pirates, thanks its commanding position with views over the city, down to the sea and across to Africa. The fortress was rebuilt by the Sultan of Granada, Badis Al-Ziri, from 1057-1063AD. As a palace, it was home to a number of Moorish rulers. The Alcazaba has a distinct feel from its more famous, younger neighbours, the Alcazar of Sevilla and the Alhambra of Granada. It was already three centuries old when the others were build.