When Muhammad arrived in Medina in 622, local tribes, mainly the Banu Aus and Banu Khazraj, had been feuding for several decades.[5] Muhammad addressed this by establishing the Constitution of Medina: a document which regulated interactions between the different factions, to which the respective parties agreed. This was a different role for him, as he had remained only a religious figure during his time in Mecca. The result was the eventual formation of a united community in Medina, as well as the political supremacy of Muhammad.[6][7]