Based on several hadiths (accounts of the prophet Muhammad, peace be upon him), and with similar elements to practices from pre-Islamic cultures, the specific fully-fledged Islamic legal form of endowment seems to date from the ninth century.
Supported by Islamic waqf law, foundations for learning institutes and hospitals were by the tenth century firmly established throughout the Islamic world. By the next century, many Islamic cities had several waqf-funded hospitals.
Institutions funded various expenses such as salaries for doctors, ophthalmologists, surgeons, chemists, pharmacists, domestics and other staff. They also paid for food, medicine, hospital equipment like beds, as well as repairs to buildings.
Waqf trusts also funded medical schools, with revenue used to cover expenses like maintaining buildings and paying teachers and students.