Battle of al-Buhayra

The Battle of al-Buhayra was a battle between the Almoravid and the Almohad armies in May 1130 CE just outside Marrakesh, Morocco.
Prelude.
In the 1121 Ibn Tumart, the founder and "mahdi" of the reformist Almohad movement, arrived in Marrakesh to preach his ideas. He even met with the Almoravid emir, Ali ibn Yusuf, during prayers at mosque and confronted him about his ways. The Almoravid political leadership became hostile to what they saw as his subversive presence and he eventually fled to the Atlas Mountains, establishing himself at Tinmal, south of Marrakesh. His influence and power grew until he eventually had the confidence to launch a military attack against the Almoravids with the help of the Berber tribes (particularly the Masmuda) allied to him. Perhaps sensing the growing threat and insecurity in the region, Ali ibn Yusuf fortified Marrakesh with its first set of ramparts in 1126.
The battle.
The battle was the culmination of an attempted Almohad assault against Marrakesh, the Almoravid capital, the center of power in the region. The Almohads, led by Ibn Tumart, initially defeated the Almoravids near Aghmat and pushed them back to the city. When the Almohad forces arrived before the city, the population was taken by surprise and there was chaos as the defenders were routed and as the inhabitants fled within the walls. Some died in the crush of people trying to pass through the narrow city gates. 
The Almohads under general al-Bashir and his lieutenant Abu Zakariyya besieged the city for forty days until Almoravid reinforcements arrived and, along with a sortie from the defenders, crushed the Almohad forces. The battle took place just east of the city and is named after a garden, "Buhayrat al-Raka'ik", which was located here near the gates of Bab Debbagh and Bab Aylan.
Aftermath.
A large number of Almohad commanders were killed. General al-Bashir died in battle, while his lieutenant, Abu Zakariyya, was wounded in the eye by an arrow. The Almohad threat to the city was staved off for 17 years (until their conquest of the city in 1147). A few months after this, the Almohad leader, Ibn Tumart, died. His death was kept secret for a period of 3 years which was called a "ghayba" or occultation. Eventually, his death was announced and Abd al-Mu'min emerged as the leader the movement and the founder of a new dynasty that lasted until its demise. Abd al-Mu'min eventually conquered Marrakesh in 1147.