The population of Khanaqin in the mid-19th century was small with only fifty Muslim and five Jewish households, with a significant Kurdish tribal population around the town. It had three mosques and three caravanserais. Khanaqin was a mere caravan station for caravans carrying Shia pilgrims before the Treaty of Erzurum in 1847 which made it a more significant frontier town between the Ottoman Empire and Qajar Iran. An immigration office was established just after the signing of the treaty to manage the growing pilgrimage. A customs house would later be established as well.