Upon the arrival of the Prophet Muhammad (PBUH) in Madinah, a significant document known as the Covenant of Madinah was established. This agreement was crucial in shaping the nascent Islamic community, as it laid the groundwork for relations between the various groups residing in Madinah, including the Emigrants (Muhajirun), the Helpers (Ansar), and the Jewish tribes. The Covenant served as a constitution for the city-state, defining the rights and responsibilities of each community.

The Covenant of Madinah established mutual defense obligations among the signatories, ensuring that all parties would come to each other's aid in the event of an external attack. It also recognized the autonomy of different religious communities, allowing them to maintain their own laws and customs while living under the overarching governance of the Prophet. This inclusivity was a novel approach to governance, aimed at fostering unity and cooperation among diverse groups.

Additionally, the Covenant stipulated that any disputes between the parties would be referred to the Prophet for resolution. This provision underscored his role as the ultimate arbiter and leader of the community, reinforcing the centrality of his leadership in maintaining harmony and justice. The document thus established a framework for peaceful coexistence and cooperation, which was essential for the stability of the fledgling Islamic state.