Once upon a time, four separate Imams led prayers in Masjid al-Haram
The daily prayers inside al-Masjid al-Haram were conducted at different times according to the four schools of jurisprudence (madhhab), and at four different locations of the Mosque.

For many centuries, from around the fifth century AH until the modern Saudi era, each of the four schools of Islamic jurisprudence (Shafi‘i, Hanafi, Maliki, and Hanbali) had its own designated place, known as a maqām or prayer station, around the Ka‘bah’s circumambulation area (Mataf).
The spots or locations of the imams or prayer leaders were marked either by pavilions which had four columns of stone supporting a dome, and a mihrab (praying niche) built between two columns that faced the congregation.
Followers of each school would pray behind their own imam.
The daily prayers inside al-Masjid al-Haram were conducted at different times according to the four schools of jurisprudence (madhhab), and at four different locations of the Mosque.
Because they were most numerous in Makkah, the followers of the Shafi'i School of law would pray first, and would do so behind maqam Ibrahim (Ibrahim's station). Their prayers would be followed by the prayers of the followers of the Maliki and Hanbali Schools of law.
The Shafi maqam was also used as a Mukabbariyya, from where the muadhin raised the adhan (call to prayer).
Related
The Shafi prayers would be followed by the prayers of the followers of the Maliki and Hanbali Schools of law. They were conducted behind the Yamani corner and at a place between the Yamani corner and the corner with the Black Stone respectively.
Lastly, the followers of the Hanafi School would pray facing the Ka'bah's northwestern side where Hijr Isma'il is located.
This was the situation with all daily prayers except the Maghrib or after-sunset Prayer. Since the time between the Maghrib and the subsequent 'Isha' or night-time Prayer is short, the former would be performed simultaneously by all four Schools.
Ibn Jubayr, the Spanish traveler, reported that when he was in Makkah in the month of Ramadhan in 579 AH/ 1184 CE, there were five simultaneousTarawih congregations inside al-Masjid al-Haram: the Shafi’i, which had precedence over the others, Hanafi, Hanbali, Maliki and even the Zaydi congregation, a Shi’ah branch that followed the Zaydi jurisprudence.
In addition, as part of al-Masjid al-Haram complex, a dozen madrasahs or colleges were also built especially by the Mamluks and Ottoman Turks wherein Islamic jurisprudence was taught in accordance with the teachings of the four Orthodox or Sunni Schools of law
This arrangement continued until 1343 AH / 1924 CE, when King Abdulaziz Al Saud, may Allah have mercy on him, took the historic decision to unite the worshippers behind a single imam for all Muslims in the Sacred Mosque. These prayer stations and their structures were gradually removed to expand the Mataf, facilitate the movement of pilgrims performing Hajj and Umrah, and emphasize the unity of the Muslim Ummah behind one imam.







