Shirgazi Khan, who build this madrassah (1714-1726), was a smart, brave, enterprising, highly skilled in the military ruler. All his contemporaries were especially amazed by the fact that he was using the stratagem completely defeating a military expedition led by prince Bekovich-Cherkassky sent by the Russian Tsar Peter I in order to seize the golden sands, located in the land of Khorezm.
In the summer of 1717 Shirgazi Khan applied stratagem, not getting into an open battle against the Russian military detachment acting for the conquest of Khiva, numbering 4,000 soldiers of infantry, 100 cavalry, six guns, 200 camels, 300 pack horses. Orderlies sent by Khan to Bekovich-Cherkassky told him, that he cannot feed so many people at the same time, so if Bekovich-Cherkassky shares squad into several parts in different places, then it would not be not be difficult to provide them with food. Deceived Prince divided the detachment into several parts and placed them in different locations. By swift blow at the same time in all parts of the detachment, the Khivans destroyed the army of Bekovich-Cherkassy.
Shirgazi Khan united fortresses Wazir, Gurlen, Shahabad, Bagalan, Hankey, Uygur, Khazarasp under its banner. During the campaign, that he led to Mashhad (North Iran) he brought from there to Khiva 5000 kizilbashes as captives (slaves). These slaves were used in the construction of the madrassah of Shirgazi Khan. Many historians have described the khan of Khiva Shirgazi Khana as enlightened and just ruler, convinced and pious man. Therefore Khan sympathized with the people of science, and enjoyed talking with them.
According to legend, narrated by the old-timers, Shirgazi Khan defeated Meshhed (1715) and bringing to Khiva 5000 prisoners, he began the construction of madrassah. Construction of madrassah was completed in 1719. Historians of that time gave him the name ?Maskani fazilan? (?House of Scientists?). And indeed, great personalities were educated and learned here. These are poet Pahlavankuli Ravnak and great Turkmen poet Makhtumkuli Firagi. At the moment of parting with madrassah after graduation Makhtumkuli wrote the following lines in gratitude:
Three years, every day you shared bread and salt with me,
I?m sorry I?m leaving, goodbye beautiful Shirgazi.
You have been my shelter in the spring, summer and winter
I?m sorry I?m leaving, goodbye beautiful Shirgazi.
The poet enthusiastically wrote in his poems, that he was pleased with the years of his life spent in Khiva. The impact of Makhtumkuli poetry is that he managed to bring his feelings about the truth of life and justice to the hearts of others:
Oh, better if people did not come to this world,
Asking to extend his life, would not have died surprising the world.
Makhtumkuli, you thank God,
The death rules both the beggars and the kings ?
Makhtumkuli wrote these verses before leaving the madrassah of Khiva, in madrassah Idrisbaba, located in the village of Kyzylayak, located around Halach, on the eve of departure to Andijan to continue there his studies after graduation in Kukeldash madrassah in Bukhara, and three-year study in madrassah of Shirgazi Khana in Khiva. At this time he was aged a little more than forty years.
The spiritual mentor of Kazakhs in Turkestan after Khoja Ahmed Yasawi, Becket Ata and the famous Karakalpak poet Adzhiniyaz gained knowledge in the madrassahs of Shirgazi Khan.
Madrasah was built in front of the mausoleum complex of Pahlavan Mahmud, its construction has several chronograms (tarikh), which are carved on marble slabs and mounted on the front of the madrassah?s portal. Four inscriptions on marble slabs survived to the present in its original form. From the inscriptions on marble slabs, installed near the entrance door of madrassah, poems in Farsi, consisting of 32 lines, we learn that Shirgazi Khan built this madrassah out of a flower garden of the world with his mind and generosity, about the land allocated for madrassah as Waqf (with 10,000 tanaps of land in the villages of Sherabad, Hayrabad, Pirnauhast, Palvanbaba every year received a very large crop of wheat, rice and white durra), what is the monthly salary of the mutevelli, the mudarris, the imam, the muezzin, the librarian, the farrash (cleaner) and other students living here. On a marble slab set behind the portal part of the madrassah the chronogram in verse was cut. Let?s take a look at the contents of one of them:
The owner of the attractiveness, the Lord, 1131 of Hijra (1720).
This madrassah from a flower garden of the world,
Shah of the world (universe) with his fairness and generosity raised it.
His good name is Shirgazi Khan,
The portal of heaven shone like the sun.
Smoke of lamp, lit in hujras
Replace the antimony for open eyes.
Ditch called Sherabad making its Waqf,
The eternity water flowed in it.
Daud?s ditch and also Pirnauhast,
He took the Well by his craft, the lion of Allah
Successes stopped and broken before,
Are restored again, and began to give the crop.
Mutevelli of madrassah takes,
According to the terms of the Waqf the one-fifth.
Imam gets hundred batmans (grain)
Muezzin gets the same.
Who is there a librarian,
His fee is one hujra.
Farrash gets 150 batmans (grain)
For good performance of the service.
The rest is for people living here,
It is issued to meet the needs.
If you leave without reason for two months (madrassah)
Hujras it taken away, and given to other.
If one of the teachers does not come for a week,
He is deprived of rights of use (privilege).
The sides, which are defined relative to the sun on the four sides,
East, west, south three gyaz (an ancient measure of length).
Towards Pahlavan ten gyaz,
It was erected in front of the eyes of the rich and ordinary people.
Tarikh (chronogram) of this building (the words) is written from ?Maskani fazilan?.
Besides, poets glorifying and exalting Khan by such epithets like ?Light of the universe? (?Khurshidi Jahon?), ?The Lion of God? (?Sheri hudo?), wrote ? ?Everyone living in this shelter will undoubtedly become a scientist, a beacon of knowledge and researcher of the mysteries.? Also, we learned details about what penalties are given to the student and the teacher, who violated the rules of study and internal regulations. Under these rules, if a student did not attend classes (in madrassah) for two months, then he was deprived of khujdras (hence their salaries), and if the teacher during a week did not come to work (madrassah), he was deprived of his salary.
Because the phrase ?home of scholars? (?Maskani fazilan?) it was found that the madrassah was built in 1132 of Hijra (1720). Shirgazi Khan was killed by his slaves, so historians took the date of his death in the chronogram from the words in Farsi, ?Save from the hands of slaves? (?Dod al gulomon?). According to abjad (a method of calculating the date by adding numeric expressions words of the Arabic alphabet), from these words the date calculated is 1139 of Hijra (1726). Khan was buried in the grave, set in hujra in the western part of madrassah.
Currently, exhibitions devoted to the life and work of the great poet of Turkmen people Makhtumkuli and the well-known Karakalpak poet Adzhiniyaz Kosibay oglu are being held in this madrassah. Exhibits are created in 1990. The author of the subject-exposition plan is Satymov U. The exhibition displays 225 exhibits. Last re-exposition was held in 2012. Effective area of the exposition is 125 m2.