During the Turkish rule, there were around 270 mosques and special Islamic prayer rooms.

After Serbia gained independence in 1878, Serbia gained the official authority to tear down all the mosques if it chose, other than the official one. That was when the Bajrakli mosque became the official Islam mosque in the city and it still stands to this day.