Sufism first developed in Arabia. Although Muhammad was eventually seen as the model for religious practice and moral behavior par excellence by the early Muslim community, a number of early Muslims sought for ways in which to carry their religious practice beyond the observance of the law or daily rituals required of all Muslims. To do so, these early Muslims drew from the deep well of Near Eastern traditions, including Judaism and Christianity, in order to develop practices and philosophies that centered on cultivating their souls. In the Near East there was a developed and long tradition of asceticism and contemplative practices centered on abstention from excessive food, an emphasis on prayer, and the cultivation of an inwardly-directed mode of devotion.
Most immediately, this meant combining elements of Islamic practice, like prayer and supplication, with modes of asceticism as they found them practiced in the Near East. New habits, including a reduction in physical comfort in the form of food, sleep, and wealth constituted a form of worldly renunciation characteristic of Christian asceticism. Such renunciation was not foreign to the tradition of Muhammad, whose humble lifestyle and approval of such was a feature of the hadith. Early Muslim ascetics actually believed that a simple life of material renunciation was more in keeping with the true message of Muhammad, an issue which could potentially become complicated by the rising fortunes and increasing wealth of the Islamic empire over the 8th century C.E.
The term "Sufi" has become commonplace today and is a catch-all term for all Muslim mystics, but the origin of the word Sufism, let alone the definition of the term, remains somewhat controversial. On the one hand, it may derive from a group of people known as Ahl al-Suffah (the people of Al-Suffah) who lived during the lifetime of Muhammad, in the 7th century. This group consisted of a number of poor émigrés who had accompanied Muhammad to Medina after facing persecution in Mecca. Destitute after having been cast out by their families, and without homes of their own, they lived in the courtyard of Muhammad's mosque. This was a group united by their status as semi-itinerants more than any coherent ideology, but their relative state of poverty resembled an ascetic lifestyle, although they were heavily engaged with the early Muslim community, not isolated from it.
Other interpretations of the term "Sufi" derive meaning from the word "saff" or row, in Arabic, which refers to the "first row standing before God" or the spiritual elect. This is a fanciful etymology, but it reflects the interiority of some definitions of Sufism. Another popular conception held by historians as illustrious as Ibn Khaldoun (1332-1406) and which is related to asceticism is that the term derives from rough woolen garments (the Arabic for wool is "suf") worn by Sufis.
Early Sufis may also have been associated with a fringe movement called the Sufiyya, which was originally marginalized for its overtly antinomian (a term that indicates being released from the obligation to follow religious law) stance. While antinomianism in general may been interpreted as a kind of disregard for the law, in this case it implied a mystical inquiry into why practice is governed by law in the first place. That is, from an antinomian perspective, practicing Islam through prescribed rites such as prayer and fasting is not an end in itself; it is important, but is only a means of disciplining the soul and purifying oneself. That spiritual goal, purification, is the desired result.
It is possible that this early group of Sufis is misrepresented, however, since all the early sources about their movement come from a perspective that was opposed to them, and it may be that they were not as anti-establishment as those sources would have us believe. In any case, these Sufis were not opposed to so-called orthodoxy, and they continued to adhere to mainstream guidelines of Islamic belief and practice. They supplemented these guidelines and practices, however, with attentiveness to cultivating a love of God, exemplified by extra supplications, prayers, poems, dance, and songs devoted to that topic.
The Sufiyya represented the first ideological claims of Sufism. They were the first, according to medieval sources, who strove for an intimate personal relationship with God based on the principles of love. The love of God is mentioned in the Quran, verse 5:54: "He loves them, and they love Him." Love of God was expressed in forms of music and poetry, especially love poetry. God was "the Beloved" and the recitation of such poems accompanied by dancing was often part of a practice whereby the listener was brought to a state of ecstasy.