The Anuradhapura Maha Viharaya was an important mahavihara or large Buddhist monastery for Theravada Buddhism in Sri Lanka. King Devanampiya Tissa of Anuradhapura (247-207 BCE) founded it in his capital city of Anuradhapura. Monks such as Buddhaghosa (4th to 5th century CE) and Dhammapala, who wrote commentaries on the Tipitaka and texts such as the Visuddhimagga, which are central to Theravada Buddhist doctrine, established Theravada Mahaviharan orthodoxy here. Monks living at the Mahavihara were referred to as Mahaviharavasins.
In the 5th century, the "Mahavihara" was possibly the most sophisticated university in southern or eastern Asia. Many international scholars visited and learned many disciplines under highly structured instruction.
Three subdivisions of Therav?da existed in Sri Lanka during much of Buddhism's early history there: Mah?vih?ra, Abhayagiri vih?ra, and Jetavana. Mah?vih?ra was the first tradition established, whereas monks who had separated from the Mah?vih?ra tradition established Abhayagiri vih?ra and Jetavana vih?ra. According to A.K. Warder, the Indian Mahsaka sect also established itself in Sri Lanka concurrently with Therav?da, into which it was later absorbed. Northern regions of Sri Lanka also seem to have been ceded to sects from India at certain times.
According to the Mahavamsa, the Anuradhapura mahavihara was destroyed during sectarian conflicts with the monks of the Abhayagiri vih?ra during the 4th century. These Mahayana monks incited Mahasena of Anuradhapura to destroy Anuradhapura vih?ra. As a result of this, a later king expelled the Mahayanins from Sri Lanka.
The traditional Theravadin account provided by the Mahavamsa stands in contrast to the writings of the Chinese Buddhist monk Faxian, who journeyed to India and Sri Lanka in the early 5th century (between 399 and 414 CE). He first entered Sri Lanka around 406 CE and began writing about his experiences in detail. He recorded that the Mahavihara was not only intact, but housed 3000 monks. He also provides an account of a cremation at Mahavihara that he personally attended of a highly respected ?rama?a who attained the arhatship. Faxian also recorded the concurrent existence of the Abhayagiri Vihara, and that this monastery housed 5000 monks. In the 7th century CE, Xuanzang also describes the concurrent existence of both monasteries in Sri Lanka. Xuanzang wrote of two major divisions of Therav?da in Sri Lanka, referring to the Abhayagiri tradition as the "Mah?y?na Sthaviras," and the Mah?vih?ra tradition as the "H?nay?na Sthaviras." Xuanzang further writes, "The Mah?vih?rav?sins reject the Mah?y?na and practice the H?nay?na, while the Abhayagirivih?rav?sins study both H?nay?na and Mah?y?na teachings and propagate the Tripi?aka"
Some scholars have held that the rulers of Sri Lanka ensured that Therav?da remained traditional, and that this characteristic contrasts with Indian Buddhism. However, before the 12th century CE, more rulers of Sri Lanka gave support and patronage to the Abhayagiri Therav?dins, and travelers such as Faxian saw the Abhayagiri Therav?dins as the main Buddhist tradition in Sri Lanka.
The trend of Abhayagiri Vihara being the dominant Therav?da sect changed in the 12th century CE, when the Mah?vih?ra gained the political support of King Parakkamab?hu I (1153-1186 CE), and completely abolished the Abhayagiri and Jetavana Therav?da traditions. The Therav?da monks of these two traditions were then defrocked and given the choice of either returning to the laity permanently, or attempting re-ordination under the Mah?vih?ra tradition as "novices" (s?ma?era).Richard Gombrich writes that many monks from the Mah?vih?ra were also defrocked:
Though the chronicle says that he reunited the Sangha, this expression glosses over the fact that what he did was to abolish the Abhayagiri and Jetavana Nik?yas. He laicized many monks from the Mah? Vih?ra Nik?ya, all the monks in the other two – and then allowed the better ones among the latter to become novices in the now 'unified' Sangha, into which they would have in due course to be reordained.