The Swahili are Sunni Muslims; even though their former Omani rulers of the sultanate of Zanzibar were Ibadhi, the Swahili were shown religious tolerance. The first mosques on the coast date from about the mid-tenth century, the identity of Swahili as Muslims dating also from that period. The central building of every town is its mosque, typically placed in a space between the two moieties; the male population assembles there on Fridays (women are not permitted to attend). In most towns, a Muslim school is built next to the mosque. There may be many mosques in a large town, built and administered privately and entailed for charitable purposes. Swahili religion is comprised of two aspects: orthodox Islam, or dini, and the set of local beliefs and practices known as mila, which are perhaps almost always originally pre-Islamic. It is often held that the dini is Arabian and associated with men, whereas the mila is African and associated with women. Both men and women, however, see themselves as orthodox Muslims, and in fact almost all observe the practices of the mila. An important part of the mila is spirit possession, which is largely practiced and controlled by women, even though they stress their Islamic purity. Women who are possessed typically join associations, even though these are in most case controlled by men, and most such associations have members of both free and of slave ancestry.
The Swahili recognize as crucial to the maintenance of their identity the concepts of ustaarabu ("civilization") and utamaduni ("urbanity"), both linked to Islam and contrasted to what they see as the ushenzi ("barbarism") of the other, non-Muslim peoples of eastern Africa. Important rites that maintain these concepts include the originally pre-Islamic "New Year," Mwaka or Nauroz, at which the towns are symbolically purified, and the regular Islamic ceremonies of Id-al-Fitr and other occasions, along with the regular public reading known as maulidi, that deal with the life and deeds of the Prophet.
Closely linked to religious beliefs and practice are forms of medical healing. Herbal medicines and possession by "doctors" are employed, as well as prayer and ritual purification. In the latter, the main practitioners are members of the clans known as Sharifu, composed of people who claim to be direct descendants of the Prophet and who live scattered in the coastal towns. All Swahili believe in the existence of many categories of both evil and good spirits, and also in that of witches and sorcerers, whose activities can be controlled by recourse to "doctors" who use both pre-Islamic and Islamic means.
The Swahili practice certain forms of visual art—the carving of elaborate wooden doors and furniture, the making of gold and silver jewelry—but the art most highly regarded is poetry. Swahili poetry is complex and of many kinds; like Islamic scholarship and knowledge, it is open to both women and men (and formerly, also to slaves). Poetry is used for both devotional and historical writings, the latter taking the form of the "chronicles" that relate the founding of the various towns and other key historical events. Today poetry is composed for both domestic and town occasions, such as weddings and competitions at New Year, and also for political purposes on radio and television.