The mosque was constructed during 1560–61 as a vakıf (legacy or perpetual endowment) of Sofu Hadım Ali Pasha, the Ottoman former governor of the Bosnia Eyalet of the Ottoman Empire, after his death in September 1560. It was built according to the classical Istanbul architectural style. The dome covers the prayer area and three small domes cover the cloister. Because of its noble proportions it stands at the top of the scale of all sub-dome mosques that have been constructed in Bosnia and Herzegovina. In the framework of the complex there is a domed burial site (turbe) with two sarcophagus of Avdo Sumbul (d.1915) and Behdžet Mutevelić (d.1915), Gajret activists who died in the dungeons of Arad. The mosque was heavily damaged by Serbian forces during the conflict of the early 1990s, especially the dome. The most recent renovation of the mosque occurred in 2004 and in January 2005, the Commission to Preserve National Monuments issued a decision to add the Ali Pasha Mosque to the list of National Monuments of Bosnia and Herzegovina.