The mosque is located in the village of Uil, Uilsky district. The construction of the mosque began in 1893. The foundation was laid out of wild stone, the building itself was built of red bricks brought from Orenburg on camel carts. The activities of the mosque were aimed at religious education.
The first imam Sagidolla Izteleuov was a literate person who spoke Arabic, Persian and Russian. In 1926 he became the Khazret of the Uilsky mosque. This is how a center for religious education appeared in the region. In 1926-1930 alone, 15 religious schools were opened in the Uilsky district, and 20 mosques were restored. The next khazret was Hasan Khazret, a graduate of the Mir-Arab madrasah in Bukhara. In the 30s of the XX century, the religious elements of the building were removed and it was transferred to the drama theater, later it was used as an economic warehouse.
The first studies of the building were carried out in 1973. In 2014, the mosque underwent major repairs, and the courtyard was landscaped. Currently, the mosque is the spiritual center of the village. The Kokzhar mosque, which was at one time a religious center, is a historical and cultural heritage of the architecture of the 19th-20th centuries
One of the stories about this mosque says that once there were underground passages connecting the shopping arcade, the mosque and the houses of wealthy merchants. The length of the underground passages, as local residents say, was several kilometers. At this time, this issue requires research. The first project of the dome of the mosque provided for a dome and was made of silver, had a crescent. Judging by popular rumor, the destroyed dome of the mosque was hidden in the local gorge during the repression.