Nalanda (IAST: Nālandā, pronounced [naːlən̪d̪aː]) was a renowned Buddhist mahavihara (great monastery) in medieval Magadha (modern-day Bihar), eastern India. Widely considered to be among the greatest centres of learning in the ancient world and often referred to as "the world's first residential university", it was located near the city of Rajagriha (now Rajgir), roughly 90 kilometres (56 mi) southeast of Pataliputra (now Patna). Operating for almost a thousand years from 427 CE until around 1400 CE, Nalanda mahavihara played a vital role in promoting the patronage of arts, culture and academics during the 5th and 6th century CE, a period that has since been described as the "Golden Age of India" by scholars. The characterisation of Nalanda as a "university" in the modern sense has been challenged by scholars. They argue that while it was undoubtedly a major centre of learning, comparing it directly to a modern university is historically imprecise.
Nalanda was established by emperor Kumaragupta I of the Gupta Empire around 427 CE, and was supported by numerous Indian and Javanese patrons – both Buddhists and non-Buddhists. Nalanda continued to thrive with the support of the rulers of the Pushyabhuti dynasty (r. 500–647 CE) and the Pala Empire (r. 750–1161 CE). After the fall of the Palas, the monks of Nalanda were patronised by the Pithipatis of Magadha. Nalanda was attacked by Huns under Mihirakula in the 5th century and again sustained severe damage from an invasion by the Gauda king of Bengal in the 8th Century. During the final invasion it was burnt down by Muhammad Bakhtiyar Khilji (c. 1200), but it managed to remain operational for decades (or possibly even centuries) following his raids.