 It was used as a residence for viceroys and later converted to a fortress.It was occupied briefly between 1798-1813 by the British Army.It was subsequently abandoned by the military and served as a prison until 1993.