Abhayagiri Vihāra was a major monastery site of Mahayana, Theravada and Vajrayana Buddhism that was situated in Anuradhapura, Sri Lanka. It is one of the most extensive ruins in the world and one of the most sacred Buddhist pilgrimage cities in the nation. Historically it was a great monastic centre as well as a royal capital, with magnificent monasteries rising to many stories, roofed with gilt bronze or tiles of burnt clay glazed in brilliant colors. To the north of the city, encircled by great walls and containing elaborate bathing ponds, carved balustrades and moonstones, stood "Abhayagiri", one of seventeen such religious units in Anuradhapura and the largest of its five major viharas. One of the focal points of the complex is an ancient stupa, the Abhayagiri Dagaba. Surrounding the humped dagaba, Abhayagiri Vihara was a seat of the Northern Monastery, or Uttara Vihara and the original custodian of the Tooth relic in the island.
The term "Abhayagiri Vihara" means not only a complex of monastic buildings, but also a fraternity of Buddhist monks, or Sangha, which maintains its own historical records, traditions and way of life. Founded in the 2nd century BC, it had grown into an international institution by the 1st century AD, attracting scholars from all over the world and encompassing all shades of Buddhist philosophy. Its influence can be traced to other parts of the world, through branches established elsewhere. Thus, the Abhayagiri Vihara developed as a great institution vis‑a‑vis the Mahavihara and the Jetavana Buddhist monastic sects in the ancient Sri Lankan capital of Anuradhapura.
It is recorded in the chronicle  that Abhayagiri Dagaba was established by King Valagamba during the period of his second reign, from 89-77 BC. A young Brahmin named Tiya (Tissa) declared war against him. Tiya was deluded by the prophecy of another Brahmin that was destined to be king. Before the arrival of Bhikkhu Mahinda, who brought Buddhism to the island, Brahmins held the highest place in society. After the establishment of the Buddhist sangha on the island, however, they lost their supremacy, and were replaced by the sangha. Some Brahmins converted to Buddhism, while others revolted. Tiya, who enjoyed the support of his community, lived both in and outside of Sri Lanka, and was therefore very powerful.
At the same time, seven Tamil chiefs landed at Mahatittha with a mighty army. Valagamba, a good diplomat, realized that his forces were too weak to fight against both of these enemies and tried to rid himself of them by making them fight each other. He sent a message to Tiya that if he could have the kingdom, provided he managed to defeat the foreign invaders. Tiya agreed, advanced with his forces to meet the Tamils, and was vanquished by them. The Tamils, elated by their success, advanced towards Anuradhapura and defeated the King, who was forced to abandon the throne and go into hiding in the mountains. As the King, defeated in battle, was fleeing Anuradhapura, a Jain monk ("nigantha" in Pali) named Giri, who headed the arama built by King Pandukhabaya near the northern gate of the city, cried out: "The great black Sinhala is fleeing." The king thereupon resolved, "if my wish (of regaining the kingdom) is fulfilled, I will build a vihara here."
During the Beminitiya Seya or period of famine and foreign rule which followed, Vattagamani Abhaya took refuge in the mountain region amassing troops until, after more than fourteen years of exile, he marched on Anuradhapura in 89 BC and defeated the last Tamil king, Bhatiya. In fulfillment of the vow made on the day of his defeat, one of his first acts was to build the Abhayagiri Vihara on the site of the Giri monastery. Mahatissa Thera of Kupikkala was appointed its Chief Incumbent as a mark of gratitude for his support in the fight against the invaders. Abhayagiri thereafter became a symbol not only of religious, but also of national, resurgence, as it signaled the end of Brahmin and Jain influence in the country.
According to the Mahavamsa, the name Abhayagiri Vihara originated from the names of King Vattagamani Abhaya and the Jain monk Giri who lived in the monastery earlier. However, since most ancient monasteries were built around a hillock, or giri in Sinhala, (for example the Vessagiri, Meghagiri or Chetiyagiri monasteries) it is possible that the name Abhayagiri symbolizes the monastery created by Vattagamani Abhaya after his recapture of the kingdom surrounding the hillock known as Digapasana, now inside the Abhayagiri complex.
Under Gajabahu I, Abhayagiri grew in prestige and importance. The accession of King Mahasena in the 3rd century AD saw the suppression of the Mahavihara monks. The king prohibited the giving of alms to them and went as far as to demolish the buildings of the Mahavihara and re‑use their materials for the construction of new buildings at the Abhayagiri. The accession of Mahasena ushered in the golden age of Abhayagiri. After the Buddha's Tooth Relic was brought to Sri Lanka in the 4th century, Abhayagiri was selected to house it for public veneration.
Ten days from now, Buddha's tooth will be brought out and carried to the Abhayagiri Monastery... on both sides of the road; the king sets images of the Five Hundred Forms which the Buddha assumed in his previous existence.'
By the time Faxian came to Sri Lanka in search of the Dhamma and visited Abhayagiri in 412 AD, it had developed into a leading Buddhist centre of Sri Lanka. By the 7th century, Abhayagiri Vihara consisted of four mulas (literally "families", fraternities or grouped institutions for religious teaching):
All of these have been located and identified through archaeological excavations, research and epigraphical evidence.
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.
According to the Chinese text Biqiuni Zhuan, the biography of the bhikkhuni compiled by Shi Baochang in 526 AD, and the biography of Gunavarnam and Sanghavarnam, the Sinhala nuns gave the second Upasampada, or higher ordination, to the Chinese nuns. According to another Chinese source, in 426 AD, eight Sinhala nuns arrived in Nanjing, the capital of the Liu Song dynasty (420–77 AD), on a merchant ship owned by man named Nandi. Consequently, three more nuns, headed by Tissara, arrived in Nanjing. Thus in the year 434, over three thousand nuns received their higher ordination for the second time in the presence of more than ten Sinhala nuns headed by Tissara at the Nanjing Temple in China.
It is also recorded that there were religious contacts between Sri Lanka and Java through the Abayagiri Vihara, at least toward the end of 8th century, as described by a fragmentary inscription from the Ratubaka plateau in central Java. This inscription records the establishment of "the Abhayagiri Vihara of Sinhalese ascetics trained in the sayings of jinas [Buddhas]." Commenting on this record, J.G. de Casparis observes, 'The most important detail is the name of the foundation, the Abhayagiri Vihara.
Abhayagiri Vihara appears to have been a center for Mahāyāna and Vajrayāna teachings; as such, it was seen as heretical by more conservative Mahavihara monks. In the 7th century CE, Xuanzang also describes the concurrent existence of both monasteries in Sri Lanka, and refers to the monks of the Mahavihara as the "Hīnayāna Sthaviras" (Pali: Thera), and the monks of the Abhayagiri Vihara as the "Mahāyā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.
As a major university and center of learning, Abhayagiri was the home of various important Buddhist scholars working in Sanskrit and Pali. These include Upatissa (who wrote the Vimuttimagga), Kavicakravarti Ananda (authored the Saddhammopåyana), Aryadeva, Aryasura, and the tantric masters Jayabhadra, and Candramåli.
In the 8th century CE, it is known that both Mahāyāna and the esoteric Vajrayāna form of Buddhism were being practiced in Sri Lanka, and two Indian monks responsible for propagating Esoteric Buddhism in China, Vajrabodhi and Amoghavajra, visited the island during this time.
The trend of Abhayagiri Vihara being the dominant Buddhist 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 traditions.
The Culavamsa narrates that (ch 78:1-27) king Parakramabahu I purified the Mahavihara first and then unified it with the Abhayagiri and Jethawana fraternities.
The 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) according to  Richard Gombrich who writes:
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.
Periodic South Indian invasions, especially in the 9th century in the reign of Sena I, almost half a century of Chola rule and the subsequent abandonment of the capital, Anuradhapura, led to the disintegration of the Abhayagiri Vihara. Despite efforts by Vijayabahu I and Parakramabahu I in the 13th century to renovate and resurrect the temple, its gradual destruction in the course of time could not be averted, particularly after the final transfer of the capital from Polonnaruwa in the Rajarata, or King's Country, to an alternative location in 1215 as a result of repeated Maga invasions.
A dark era of eight hundred years engulfed Abhayagiri Vihara until its rediscovery in the 1880s awoke scientific and scholarly interest in the abandoned and vandalized ruins. Mistakenly identified at first as Jetavana Vihara, they were photographed and drawn by specialists in the late 19th century, while the Department of Archaeology, established about the same period, undertook excavation and conservation work of some of the edifices at the beginning of the 20th century.
Veneration of Avalokiteśvara Bodhisattva has continued to the present day in Sri Lanka, where he is called Natha. Avalokiteśvara worship is a prominent practice in Mahayana, while the Maithreya Bodhisatta (Santhusitha) is venerated by Theravadins. In more recent times, it has been attempted to identify Nātha with Maitreya Bodhisattva. However, traditions and basic iconography, including an image of Amitābha Buddha on his crown, identify Nātha as Avalokiteśvara. Andrew Skilton writes:
... It is clear from sculptural evidence alone that the Mahāyāna was fairly widespread throughout [Sri Lanka], although the modern account of the history of Buddhism on the island presents an unbroken and pure lineage of Theravāda. (One can only assume that similar trends were transmitted to other parts of Southeast Asia with Sri Lankan ordination lineages.) Relics of an extensive cult of Avalokiteśvara can be seen in the present-day figure of Nātha.
Early reports by Europeans from the 18th century describe the Buddhist monks of Sri Lanka as being engaged in the recitation of mantras, and using mālā beads for counting, as practiced in Mahāyāna Buddhism.
The architectural elements of the buildings excavated at Abhayagiri Vihara clearly reflect the social beliefs and religious practices prevalent at the time. Although Buddhism was the state religion and the principal doctrine followed by the majority of the population, the influence of other local beliefs, particularly Hinduism, were considerable, and are expressed in the architecture of the period. The design of entrances, for example, illustrates the practice of placing buildings under the protection of a guardian deity.
The two slabs erected on either side of the foot of the flight of steps leading to a building are known as guard stones (Muragala). They are usually carved, although plain guard stones have also been found. Among the Hindu symbols represented on these stones, the most common, apart from the Pot of Abundance and Kalpavrksa, is the figure of the Nagaraja, or anthropomorphic King Cobra. The best example of these, and one of the finest guardstones yet discovered, was found at the Ratnaprasada in Abhayagiriya, and illustrates the degree of perfection reached by the sculptors of Abhayagiri. Lotuses and punkalas are indicative of plenty. Representations of the lotus are of particular significance in agricultural societies where they symbolize the daughters of the guardian deity of rain. The elephant figure at the Eth Pokuna is also a symbol of water.
The principal Buddhist guardian deities are frequently indicated by the animal vehicles of the particular gods, particularity on the guard stones. A good example is furnished by the exquisite statues on either side of the entrance to Abhayagiri Stupa. The head‑dress of one of the statues is a conch while that of the other is a lotus. Representing Sanka and Padma, the two principal treasure houses of Kuvera, they are believed to have been erected to ward off any evil or danger that might threaten the stupa or its precinct. Even at present they are commonly believed to be endowed with mystic powers, and courts of law in Anuradhapura accept swearing before the statues as evidence in settlement of minor disputes between litigants.
The best example of a moonstone, a unique creation of Sri Lanka sculptors, can be seen at the foot of the steps leading to the Pancavasa commonly known as Mahasena’s palace. A smaller example, just as exquisitely carved, was found nearby at the Queen's Pavilion. Varying in shape and size and made of different kinds of stones, all are exquisite artistic creations. According to Paranavitana, the moonstone symbolizes samsara, the endless cycle of rebirth, and the path to freedom from the samsaric process leading to nirvana. He interprets the pattern of the outermost ring as flames, and the various animals shown in the other concentric circles as successive phases of man's passage through samsara.
Over the course of 15 years, the Abhayagiri Stupa was fully restored and renovated by the Sri Lankan Central Cultural Fund as a UNESCO project for a total of Rs519.5 million (US$3.9 million). It was unveiled in June 2015 with President Maithripala Sirisena and Prime Minister Ranil Wickremesinghe attending.