For the first few centuries of Islam, muftis were educated in informal study circles, but beginning in the 11th and 12th centuries, the ruling elites began to establish institutions of higher religious learning known as madrasas in an effort to secure support and cooperation of the "ulema" (religious scholars). Madrasas, which were primarily devoted to the study of law, soon multiplied throughout the Islamic world, helping to spread Islamic learning beyond urban centers and to unite diverse Islamic communities in a shared cultural project.