This madrasah is located in the heart of Itchan Kala in front of the mausoleum of Pahlavan Mahmud. It was built by slaves that were captured in 1718 by Shergazi Khan, during his raid to Khorasan and Mashhad.
Shergazi Khan promised to liberate the slaves as soon as the construction of madrasah would be completed, but he did everything possible to delay the completion of the construction. In 1720 enraged prisoners killed Shergazi Khan in an unfinished madrasah. His mausoleum is attached to the western corner of the madrasah’s main facade. Madrasah Shergazi Khan is on the oldest and largest buildings in Khiva. The building of the madrasah is one-storeyed, except the two-story entrance, four-aivans courtyard, vestibule rooms and lecture hall. In this madrasah the famous Turkmen poet Makhtumkuli was teaching, and Jawaharlal Nehru studied there.