Hadzi Mahmud Bey Mosque is located in todays old Bitola bazaar, close to the river Dragor.
In the times of Evliya Çelebi this part of the market belonged to the Turners (Çekrekçi) and to the Tailors, in the vicinity of the Horse market (At-pazar).
The mosque was built in 1521-22 and it was renovated in 1873.
The founder of the mosque and its complex was Haci Mahmud Bey, known in the town as ‘Tomruk Aga’ (The prison warder). He may have been one of the war heroes (Gazi) of Sultan Bayezit Han and for that reason he was appointed as governor of the town, which he ruled in a despotic manner.
The mosque was severely damaged during the First World War.
The minaret of the mosque collapsed during an earthquake in 1996.
Some parts of the mosque were reconstructed and renovated in 1991. It was supervised by the Institute for the Protection of the Monuments in Bitola. These days the mosque is used as a warehouse surrounded by shops.