The Karamanids traced their ancestry from Hodja Sad al-Din and his son Nure Sufi Bey, who emigrated from Arran (roughly encompassing modern-day Azerbaijan) to Sivas because of the Mongol invasion in 1230.