The primary purpose of the Imperial Harem was to ensure the birth of male heirs to the Ottoman throne and secure the continuation of the direct patrilineal (male-line) descendance of the Ottoman sultans.