Prophet Mohammed seems to be the first Sufi, communing directly with Allah. The early followers who were with him received revelations from God directly through them and formed the early Sufi school. The Hadith talks about ‘Ihsan’ or worship as one of the aspects of Islam and the Quran also talks about the purpose of God creating humans and Jinns is so that they may worship him.“I created the Jinns and humankind only that they may worship me.” Quran 51:56“He (the inquirer) said: You have told the truth. He again said: Inform me about Ihsan. The Prophet replied; That you worship Allah as if you are seeing him, for though you don’t see him, verily he sees you” – Hadith, Sahi Muslim Book 1:1
Early Sufism started as brotherhoods or tariqas. Over the time as it progressed into the middle ages, it developed a distinct feature of having a ‘Shayk’ or a guru who as a head of a Sufi school taught disciples to live out Islam. Sufism came to be identified with these tariqas and the ‘shayk’ who headed these had distinctive practices which came to define them and give them identity.Sufism is the branch of Islam which could accomodate local Islamic practices and cultural variations and provide people a culturally relevant local variant of Islam. Sufism was also very missional and brought a lot of people in Asia into the fold of Islam.
“In India, for example, the tomb of Moinuddin Shishti attracts Hindu and Muslim pilgrims. It has long been argued by scholars and advocates of Sufism alike that Sufism contributed to the spread of Islam in South Asia by forming cultural alliances between Muslims and other religious communities. Nizamuddin Awliya, a Sufi saint whose shrine is in Delhi was famous for his advanced practice of Yoga. This type of cultural adaptation was bidirectional: Ramanand, a Hindu religious preacher was likewise influenced by Sufism, and one of his disciples claimed that both religions revered the same God.” 
Mainstream Islam or Sunni Islam persecuted the Sufis for their heterodox beliefs. One Sufi who claimed to have dissolved his self in his mystical union with God was crucified and killed. 
“One of the most famous cases of the execution of a mystic at the hands of the Muslim authorities is that of Al-Mansur al-Hallaj (b. 857), a mystic who was tortured and crucified in 922. Crucifixion was a common punishment in the ancient world for many centuries before the lifetime of Al-Hallaj. In this case, it included being tied to a cross-like structure and bound at the hands and feet, and as an additional torture, his hands were chopped off……..He made a second pilgrimage, then spent a period of his life outside of the Islamic realm, in India and Turkistan. When he returned to Mecca a third time, his asceticism was more pronounced, and he is reported to have prayed that God reduce him to nothingness. After returning to Baghdad, he reportedly built a home shaped to resemble the Kaaba, the sanctuary at Mecca. His preaching became provocative, centering on the theme of self-annihilation. He claimed to have attained mystical union with God, a charge for which he was sent to trial. He was eventually killed, under the official charge of sedition, though hagiographical accounts written by his devotees assert that it was for having reportedly said, “I am the Truth,” meaning that he had been joined mystically with God (known as Al-Haq, the Truth). The utterance was meant to imply that al-Hallaj had been sublimated, that he was no longer existent, that there was “no I left,” only God. In a way, he was claiming to be God, which tremendously offended the orthodox authorities. For this perceived blasphemy, he was publicly tortured and crucified. Al-Hallaj’s preaching and spectacular death represent a moment of social upheaval in the history of Sufism. “ 
Sufism through it’s missionary activity spread to South Asia, South East Asia and North Africa. In these parts it became a part of the culture and heritage by it’s contribution to art, music and litereature. In modern times Sufism has spread to Europe and U.S as well.“Sufism appeared in Europe in the early 20th century, in a Swiss branch of an Algerian tariqa known as the Alawiyya. From there it spread to France, England, and the United States. The Naqshabandi order is well established in the United States. “