It is assumed that today's Bajrakli Mosque was built on the place of an older mesdzid, probably in the second half of the 17th century, as the endowment of the Turkish ruler Sultan Suleiman II (1687—1691).