Any act of worship that follows the Islamic rules of prayer can be said to create a mosque, whether or not it takes place in a special building. Informal and open-air places of worship are called musalla, while mosques used for communal prayer on Fridays are known as jāmiʿ. Mosque buildings typically contain an ornamental niche (mihrab) set into the wall that indicates the direction of Mecca (qiblah),ablution facilities and minarets from which calls to prayer are issued. The pulpit (minbar), from which the Friday sermon (khutba) is delivered, was in earlier times characteristic of the central city mosque, but has since become common in smaller mosques. Mosques typically have segregated spaces for men and women. This basic pattern of organization has assumed different forms depending on the region, period and denomination.
The first mosque was built by Muhammad in Medina. With the spread of Islam, mosques multiplied across the Islamic world. Sometimes churches and other temples were converted into mosques, which influenced Islamic architectural styles. While most pre-modern mosques were funded by charitable endowments, modern states in the Muslim world have attempted to bring mosques under government control. Increasing government regulation of large mosques has been countered by a rise of privately funded mosques of various affiliations and ideologies, many of which serve as bases for different Islamic revivalist currents and social activism. Mosques have played a number of political roles. The rates of mosque attendance vary widely depending on the region.