The earliest Muslim presence in Germany can be traced back to the arrival of Muslim prisoners of war during the reign of King Friedrich Wilhelm I of Prussia after the Second Siege of Vienna in 1683 and the Russo-Turkish War of 1735-1739. While some captives were baptized and converted to Christianity upon their arrival, others were permitted to maintain their Islamic faith. Notably, the orphanage housing these prisoners even provided a masjid for them to practice their religion. Subsequently, the establishment of the Ottoman embassy in Berlin in 1763, facilitated by positive diplomatic relations between the Ottoman Empire and the Kingdom of Prussia, marked a significant turning point, granting the Muslim presence in Germany a formal and officially recognized status. Upon the passing of the third Ottoman Ambassador, Ali Aziz Efendi, in Berlin in 1798, King Wilhelm III designated a dedicated Muslim cemetery in the Columbiadamm area of Berlin-Neukölln. This marked the final resting place for the Ambassador, and subsequently, other members of the Muslim community were also interred there. Notably, the Berlin Sehitlik (Martyrs’) Mosque was constructed within this cemetery in 2003.

The first known mosque on German soil was built in the place called “Halbmondlager (Half Moon) Concentration Camp” in Wünsdorf, near Berlin. The construction of this mosque is linked to the circumstances of World War I when the Ottoman Empire sent military personnel to Berlin to assist with the care of Muslim prisoners of war. Built in 1915 for these prisoners to worship, the wooden domed building with a minaret did not last long and was demolished in 1930 due to lack of maintenance.

In addition to those who preferred to stay in Germany despite the repatriation of many prisoners after the war, students and academics who came to Berlin to study from different Muslim countries and German converts founded the “Berlin Islamic Community” in 1922. By 1930, this burgeoning community, numbering approximately 1,800 members, solidified its presence as the first official German-Muslim community, paving the way for the development of similar communities throughout the country.