This major Old City landmark dates from the 13th century, built in sandstone by the Mamluks, a multinational military caste which originated in Egypt as slave soldiers and mercenaries and whose influence grew to the point where a Mamluk Sultanate ruled Egypt, the Levant (of which Gaza is a part), and western Arabia for 132 years. The second story was added by the Ottoman Turks who came after the Mamluks, and now it serves Gaza´s official museum of antiquities. It´s also known as Ridwan Castle (after the Ottoman dynasty which ruled Palestine in the 16 and 17 centuries) and Napoleon´s Fort (because Bonaparte supposedly briefly used it in 1799 during his army´s military campaign in Egypt and Palestine).
Read more in my post Will Tourism in Gaza Ever Exist? If So, Here Are 8 Spots Worth Seeing.