The Red Fort was a 17th century palace for Muslim Mughal emperor Shah Jehan .