The Khujandi family was a Shafi'i family of religious scholars based in the city of Isfahan in central Iran, who played a leading role in Isfahani politics during the Seljuk era and up until the Mongol invasion. Their name refers to their hometown of Khujand in Transoxiana, which was then under Qarakhanid rule. The founder of the family was Abu Bakr Muhammad ibn Thabit al-Khujandi, who was appointed the head of a Shafi'i school in Isfahan by the Persian vizier of the Seljuks, Nizam al-Mulk. Owing to their origins, the Khujandis manifested a Khurasanian identity, but by the 12th-century they had adopted the western Iranian identity of the locals.