. According to the Sri Lankan chronicles
Dipavamsa and
Mahavamsa, north Indian
prince Vijaya and his seven hundred followers were blessed by god Upulvan upon their arrival to Sri Lanka in 543 BC. The second appearance of god Upulvan in literary sources occurs in the 7th and 8th centuries and again after a gap of several centuries his name reappears in 13th and 14th centuries as the god par excellence. Though god Upulvan is mentioned in Mahavamsa as the guardian deity of Sri Lanka, the first reference to the worship of Upulvan is dated to the 13th century.
Kotte era poem
Panditha Perakumba Siritha describes a story of how god Upulvan transfigured a log of a kihiri tree and floated it to the sea beach of Devinuwara kingdom in Southern Sri Lanka. On the night prior to the incident, King
Dappula I (661–664) who was the reigning monarch, had a dream about the arrival of this transfigured kihiri log. Accordingly, the king and his people rushed to the beach and recovered the kihiri log. They carved the god's figure out of the kihiri log, and brought it ceremonially for enshrinement. The poem further states that the wood of the said kihiri log was also used as a medicine for treating various diseases. The
Paravi Sandesaya, written by
Thotagamuwe Sri Rahula Thera in the 15th century mentions the name of the consort of god Upulvan as Sandavan Biso, and they have a son named Dhanu also called Janak. In the medieval period local deities, namely Upulvan,
Katharagama,
Saman and
Vibhisana came to be worshiped as protectors of the island. The 14th century inscription of King
Buvanekabahu IV is the first inscription that refers to the guardian deities of Sri Lanka. Within the same century
Nissanka Alagakkonara erected four shrines for the guardian deities when he was constructing the fortress of
Kotte. God Upulvan seems to have been the most popular of these guardian gods and his main temple was located at Devinuwara (Dewundara) in Matara.
Dewundara Devala Sannasa speaks of land dedicated to the temple by the ancient kings of Sri Lanka. A second temple for god Upulvan was erected by
King Parakkramabahu IV at Aluthnuwara, Satara Korale in
Kegalle District. Evidence reveals that land and other endowments were made to this temple up to the beginning of 17th century. ==Identification with Vishnu==