It stands on the site of the previuous palace, called Bait As-Sahel that was destroyed in the Anglo Zanzibar war of 1896. 
The present palace was built in late 19th century to serve as a residence for the Sultan's family.
<a href="//commons.wikimedia.org/wiki/User:Erasmus_Kamugisha" title="User:Erasmus Kamugisha">Erasmus Kamugisha</a>
CC BY-SA 4.0
<span class="int-own-work" lang="en">Own work</span>