The choice of "Yathrib" (Medina) as the refuge for the Prophet Muhammad (peace be upon him) and the Muslims was not merely a personal decision made by the noble Prophet, but rather a purely divine choice. For several years, the gaze and thoughts of the Prophet (peace be upon him) did not turn towards the people of Yathrib, nor was it in his fate to meet them and present his call to them. Instead, his thoughts were directed towards the outskirts of the Arabian Peninsula, away from the dominance of Quraysh. As he said one day to his companions: "I saw in a dream that I was migrating from Mecca to a land with palm trees, and my concern (i.e., my assumption) was that it was Al-Yamamah or Hajr, but it turned out to be the city; Yathrib." (Narrated by Al-Bukhari).
The Muslims did not establish their first city, as Yathrib was more ancient than the Islamic migration to it. However, it was perfectly suited for the establishment of the nascent state, as it boasted a natural fortification that qualified it to withstand the coming struggle. It was surrounded by two vast lava fields with rugged, jagged rocks that armies could not navigate. To the south were the palm groves and fortifications of the Jews and Arabs, while the only area requiring caution was to the north, where Mount Uhud was located.
In terms of demographic composition, it was fractured between two warring Arab tribes: the Aws and the Khazraj, along with Jewish tribes that supported the warring Arabs, stirred their fears by suggesting that a prophet would come in his time and that the Jews would follow him, leading to the destruction of the Arabs like the people of 'Ad and Iram! Therefore, the mention of the coming prophet prepared the minds of the people of Yathrib to accept the forthcoming message and motivated them to hasten towards it. How they desperately needed a prophet to unite their hearts, to end years of fierce conflict among them, and to bring a message that would unleash their energies away from internal strife, allowing them to play a hoped-for historical role and form a unity that would protect them from the threat of the crafty Jews.
The city's location was most suitable for opposing the Quraysh, as it lies on their trade route to Syria, allowing them to besiege them economically, as trade was their source of income and the secret to their wealth. Additionally, the people of the city were known for their warfare and support, inherited from their long-standing conflicts. The city also enjoyed self-sufficiency in agriculture and food, providing a safeguard against the expected threat of a siege from the polytheists.
Since the majority of the inhabitants of Yathrib were young, many of their elders were lost in the years of conflict between their tribes, and their historical leaders were wiped out. Perhaps, had they lived longer and embraced Islam, they could have been a stumbling block in its path. This is not far-fetched if we consider the lives of those who remained and opposed the new religion, such as Abdullah ibn Ubayy and Abu Amir
As soon as the Prophet Muhammad (peace be upon him) migrated to it, the city took on a new character that suited the novelty of the religion, solidified its values, and prepared it to lead the emerging state, protect its creed, and spread its guidance. The first building established there was the mosque, which served as the center for worship and leadership, around which were the chambers of the Prophet (peace be upon him), serving as models and inspirations. Near the mosque, a spacious area was designated for the prayers of the two Eid festivals. The streets and alleys of the city spread out from the heart where the main mosque is located, beginning from it and flowing into it, linking the activities of life to the place of proximity and prayer.
The streets of the city were characterized by their functional considerations; their widths were proportional to the needs of the residents for passage, access, and the movement of their animals. The Prophet Muhammad (peace be upon him) said: “If you disagree about the road, make it seven arm spans wide” (reported by Abd al-Razzaq and Ahmad). His saying, “If you disagree,” implies that the original principle is for the width of the roads to be based on necessity, except in cases of disagreement. The secondary and side streets were narrow, and winding compared to the main thoroughfares. The closeness of buildings and the narrowness of the streets were characteristic of the architectural planning of cities at that time, achieving practical benefits related to facilitating the defense of the city if targeted by an enemy, protection from dust and sand in a desert environment, and providing shade in a hot and sunny environment, in addition to a desire for increased social interaction in a tightly-knit tribal community.
The Prophet Muhammad (peace be upon him) built the market to the west of the mosque, establishing it as an institution for achieving an economy based on Islamic principles. Its location was unique, as the mosque serves as the center of Muslim life and the hub of activity for both residents of the city and visitors. It is the architectural heart of the city, from which its roads and streets branch out, making it easy to access. This location also facilitated easy communication with trade routes to the Levant, Yemen, Mecca, and the lands of the nearby Arab tribes, without the need to navigate around the houses or weave between them.
To the east of the mosque was the cemetery of Al-Baqi‘; Al-Baqi‘ Al-Gharqad. Each tribe chose a part of it for their graves. In the city, designated houses were set up for hospitality, where delegations and guests would stay. Twenty parasangs away from the city, the Prophet Muhammad (peace be upon him) designated the Naqi‘ for grazing the horses of the Muslims, and then he designated Al-Rabadhah for the camels of charity.
Thus, a number of factors emerged that were maintained in the planning of the Prophet's city, the most prominent of which is the religious factor. The city will remain for three and a half decades the capital of Islam, a destination for migration, and a center for preaching, education, and the transmission of religious and moral values. The mosque played multiple roles such as prayer, teaching, adjudication, issuing fatwas, spiritual and political leadership, and social integration. All urban units were connected to it through the main roads that lead from and converge into it.
The city also achieved the demands for military protection through its natural fortifications from its eastern and western hills, its fortress, and its orchards that encircle it from the south. It ensured its resilience through the availability of food production and its water wells, especially during times of siege and danger, alongside the well-known military experience and expertise of its people. Each tribe resided in its own designated area, which fostered social cohesion and rapid response to political assignments and military necessities. The immigrants who came to the city did not disrupt this tribal unity; they settled in the homes of the Ansar after brotherhood was established between the immigrants and the Ansar following the migration, or they lived on lands that were not yet built upon, which the people of the city had generously donated.
Near the city, there were suitable areas for grazing and collecting firewood, which enabled the Prophet Muhammad (peace be upon him) to designate places for the sanctuary, for the camels of charity and the horses of jihad. Medina was a land known for its diseases before the migration, and when the Muslims migrated there, a fever struck many of them. This led the Prophet (peace be upon him) to pray to Allah to avert its plague and fever, saying: "O Allah, make Medina dear to us as we love Mecca, or even more, and purify it, and bless us in its measurements and portions, and transfer its fever and make it at Al-Juhfa." (Narrated by Bukhari).
The planning of the Prophet's city was a source of inspiration in the establishment of Islamic cities in the following phase, in Basra, Kufa, Fustat, and then Kairouan. The construction of the mosque was prioritized first, in the center, from which the main streets branched out. Additionally, there were conditions added that were taken into account as a result of the evolution of state circumstances and the multiple reasons for construction. Basra and Kufa were initially built to be military camps for the conquering armies in Iraq and Persia. Umar, may Allah be pleased with him, ordered that the Muslims choose a location for them at the edge of the Arabian desert where it meets the fertile land of Iraq, to ensure a suitable environment for the health conditions that the Arabs thrived in, characterized by a dry environment, and moving air. There was no river separating them from the Arabian desert, allowing the caliph to move to them without hinderance should he wish. This was the same instruction given by Amr ibn al-As when he established Fustat, selecting a location that was not separated from the Arabian Peninsula by the Nile River.
The choice of Fustat as an alternative capital to Alexandria was made to ensure the safety of the capital of the country and to protect it from the Roman naval invasions threatening the Islamic coasts, as the Muslims at that time did not have a naval fleet.