The temple was established during the reign of King Parakramabahu VI in the 15th century, when Kotte became the capital of Sri Lanka. During this period, Buddhism flourished under royal patronage, and the temple served as a centre for religious activities, education, and the preservation of Buddhist traditions. Over the centuries, the temple has been renovated and carefully maintained while preserving its historical significance.
The shrine room (Image House) of Kotte Rajamaha Viharaya was originally built during the reign of King Parakramabahu VI (1412–1467), when the temple served as the main Buddhist monastery of the Kotte Kingdom. Historical records describe it as the "Oth Pilima Geya" (House of the Reclining Buddha), which contained a large reclining Buddha statue. It was one of the principal buildings of the ancient temple complex, together with the stupa, Bodhi tree, and Temple of the Tooth.
During the Portuguese invasion in the 16th century, Kotte Rajamaha Viharaya suffered severe damage. Many temple buildings and valuable religious artifacts were destroyed as the Portuguese expanded their control over the Kotte Kingdom. Despite this destruction, the temple was later restored (19th century) by devoted Buddhists and continues to be an important place of worship today.