After the destruction of the Ma'arib dam of Yemen a large part of the lands of Yemen became uncultivable. The opening of the sea route of the Red Sea and the deterioration of the economic importance of Yemen was the pretext for their migration, and it is possible that each of these two things had an effect on the scattering of the Qahtani tribes of Yemen.
In any case on whatever pretext it might have been, the Almighty Allah brought these two tribes of Yemen to Yathrib and made them settle there, and eventually when it became intolerable for the Holy Prophet to continue to live in Makkah amongst his relations, these two tribes received him and his immigrant companions, gave them place in their houses and preferred them even to themselves.
From the day these two tribes called Aws and Khazraj came to Yathrib and settled there, they were continuously fighting with each other till they were fed up with this state of affairs and realized that if they continued to fight they would be annihilated and the Jews of Yathrib belonging to the tribes of Bani Nazir etc. would prevail over them. Some of them were, therefore, obliged to go to Makkah to seek assistance from Quraysh so that they might become exalted and powerful.
However, Quraysh put forward certain conditions which were not acceptable to them. Then they went to Taif and sought the assistance of the tribe of Thaqif. However, they also dilly- dallied and the persons from Yathrib returned home without achieving any result. In the meantime the Holy Prophet had made his call public in the 4th year of his mission. For ten years continuously he contacted the people in the bazaars of Arabia like ukkaz and Zul Hijaz and the pilgrims during Haj season at Mina, Makkah etc. and invited them to Islam. He asked them to assist him and support his Divine mission so that they might be rewarded with Paradise.
He approached various tribes one after the other and said to them: "O people! Say that there is no deity but Allah so that you may be delivered, rule over the Arabs and non-Arabs and become the chiefs in Paradise as a result of your faith. None of the Arab tribes except Aws and Khazraj of Yathrib agreed to receive the afflicted homeless Muslims. It was only this sacred city which could embrace the Holy Prophet of Allah forever. As a consequence of the demise of Abu Talib and Khadijah in the l0th year of the Holy Prophet's mission it became very difficult for him to stay on in Makkah.
The city of Taif also did not accept him. In the circumstances he made greater efforts to contact the various tribes. After having one or two brief contacts with the people of Yathrib he met a group of persons belonging to that city in the vicinity of Mina in Haj days in the 11lth year of his mission and asked them: "Who are you?" They replied: "We belong to the tribe of Khazraj". The Holy Prophet said: “Are you confederates of the Jews?" They replied: "Yes". The Prophet asked: "Won't you sit with me so that I may have a talk with you?" They replied: "Certainly". They then sat down with the Prophet of Allah and he invited them to Islam and recited verses of the Holy Qur'an for them. After hearing the Holy Prophet the people belonging to Yathrib said to one another: "By Allah this is that very Prophet about whose prophethood the Jews used to warn us.
These persons who were six in number and belonged to the tribe of Khazraj accepted the invitation of the Holy Prophet. All of them embraced Islam on the spot and said: "We have courted our people's enmity and are at the juncture of warfare. We hope that the Almighty Allah will create mutual love in them through you. We are now returning to Yathrib and shall invite them by means of this religion.
In that event you will become very honored and powerful among us. At this time the Qahtanis of Yemen i.e. the tribes of Aws and Khazraj were accepting the Holy Prophet's invitation to Islam, providing preliminaries for his migration to their city and discerning in him ability to unite their two tribes, which had been fighting with each other for many years.
Meanwhile the relatives of the Holy Prophet and the distinguished persons amongst Quraysh were planning to kill him and did not consider any thing more necessary to achieve their prosperity and good luck than to put an end to his life.
These six persons belonging to the Khazraj tribe returned to Madina, informed the people about their meeting and conversation with the Holy Prophet as an important news. It was an important matter and a harbinger of honor and prosperity for them. They invited the people to embrace Islam. Islam began to spread soon in the favorable atmosphere of Madina and there was not a single house of Aws and Khazraj where the Prophet of Allah was not talked about. The number of the Ansari Muslims who were the first to embrace Islam has been reported by some writers to be two and by others to be eight.
In the following year i.e. in the 12th year of the Holy Prophet's mission twelve persons belonging to Madina took the oath of allegiance to him in Aqabah (Mina) during Haj season. These persons consisted of five out of the six persons who had taken the oath in the previous year and seven others. They swore that they would not associate anyone else with Allah, would not commit theft and adultery, would not kill their children, would not beget illegitimate children and would not disobey the Prophet of Allah and would perform good deeds.
The Holy Prophet also promised them that if they remained faithful they would be sent to Paradise. He also told them that if they committed any of these evil acts and were punished for it, the punishment would constitute atonement for it. In case, however, the crime remained undetected till the Day of Judgment the decision would rest with Allah. He might punish them for it, or might forgive them".
The twelve persons returned to Yathrib and the Prophet of Allah sent Mus'ab bin Umayr Abdari along with them so that he might teach the Qur'an and invite everyone to embrace Islam. Mus'ab invited the people to Islam with so much zeal that this religion spread very rapidly and Muslim men and women could be found in every quarter of the city inhabited by Aws and Khazraj. In the 13th year of the prophetic mission seventy five persons consisting of men and women met the Holy Prophet near Mina and took the oath of allegiance to him in the presence of his uncle Abbas.
This oath was taken at midnight after the Haj ceremonies. Abbas had not embraced Islam till then but was present at that time because he was interested in the safety of his nephew. He took a promise from them that they would abide by their words and would not make the Prophet of Allah leave his home unnecessarily.
Ya'qubi writes: "They requested the Prophet of Allah to accompany them to Madina and undertook to defend him against his own people as well as against the strangers and the black- skinned as well as the redskined people. Abbas bin Abdul Muttalib then said: "May my parents be your ransom! Let me obtain a promise from them."
The Prophet of Allah entrusted this task to his uncle and Abbas obtained a promise from them that they would support the Prophet of Allah and his people just as they supported their own people and children, would fight against, the black-skinned and the red-skinned people for his sake and would assist him against his relatives as well as against the strangers. The Holy Prophet also promised that he would honor this pact and added that their place would be in Paradise".