The belief that spirits can possess a person is not something new. It is also believed in various cultures, religious or atheistic. Different cultures have different ways of expelling the spirits from the possessed person. Ancient practices include trephining (drilling a hole in the skull) to release the spirit.
In Islam, the different species of spirits are collectively referred to as jinn in the Arabic language. The terminology "jinn" in Islam has a different concept from the terminology "spirits" as believed in many other cultures. Many would attach the word "evil" to "spirits" but not all jinn are evil. There are also civilised jinn who have their own system of governance and believe in religion.
Although the word "jinn" is used in Islam, it does not mean that jinn have never entered the human body before Islam. Semitic religions before Islam have their own ways of dealing with jinn. The Quran was not revealed then, so it is obvious that they did not use any Quranic verses. One of the methods in Islam that is used for the exorcism is ruqyah. Ruqyah means incantation. With the arrival of Islam, guidelines were put in place forbidding all polytheistic practices including prohibition of having polytheistic contents in incantations. In one instance, from an authentic narration, Prophet Muhammad (peace and blessings be upon him) even approved an incantation from pre-Islamic period (meaning non-Quranic incantation) that did not have any polytheistic content. In other words, Islam defined polytheism as a boundary that must never be crossed.