A mosque is a place of worship for followers of Islam. The mosque serves as a place where Muslims can come together for salat as well as a center for information, education, social welfare, and dispute settlement. The imam leads the congregation in prayer.
The first mosque in the world is often considered to be the area around the Kaaba in Mecca now known as the Masjid al-Haram. Since as early as 638 AD, the Masjid al-Haram has been expanded on several occasions to accommodate the increasing number of Muslims who either live in the area or make the annual pilgrimage known as hajj to the city. Others regard the first mosque in history to be the Quba Mosque in present-day Medina since it was the first structure built by Muhammad (sallAllahu 'alayhi wa sallam) upon his emigration from Mecca in 622. Prophet Muhammad (sallAllahu 'alayhi wa sallam) went on to establish another mosque in Medina, which is now known as the Masjid an-Nabawi, or the Prophet's Mosque.
All mosques have rules regarding cleanliness, as it is an essential part of the worshippers' experience. Muslims before prayer are required to cleanse themselves in an ablution process known as wudu. However, even to those who enter the prayer hall of a mosque without the intention of praying, there are still rules that apply. Shoes must not be worn inside the carpeted prayer hall. Some mosques will also extend that rule to include other parts of the facility even if those other locations are not devoted to prayer. Congregants and visitors to mosques are supposed to be clean themselves. It is also undesirable to come to the mosque after eating something that smells, such as garlic.
As mosques are places of worship, those within the mosque are required to remain respectful to those in prayer. Loud talking within the mosque, as well as discussion of topics deemed disrespectful, is forbidden in areas where people are praying. In addition, it is disrespectful to walk in front of or otherwise disturb Muslims in prayer. The walls within the mosque have few items, except for possibly Islamic calligraphy, so Muslims in prayer are not distracted. Muslims are also discouraged from wearing clothing with distracting images and symbols so as not to divert the attention of those standing behind them during prayer. In many mosques, even the carpeted prayer area has no designs, its plainness helping worshippers to focus.
There is nothing written in the Qur'an about the issue of space in mosques and gender separation. However, traditional rules have segregated women and men. By traditional rules, women are most often told to occupy the rows behind the men.
The mosque played a major part in the spread of education in the Muslim World,and the association of the mosque with education remained one of its main characteristics throughout history, and the school became an indispensable appendage to the mosque. From the earliest days of Islam, the mosque was the center of the Muslim community, a place for prayer, meditation, religious instruction, political discussion, and a school. Anywhere Islam took hold, mosques were established; and basic religious and educational instruction began.