Peppered with natural cave shelters and rock overhangs – supplemented over the centuries by numerous hand-hewn additions and modifications – Sigiriya may have been inhabited in prehistoric times.

The established historical theory is that the rock formation served royal and military functions during the reign of King Kasyapa (r 477–495), who built a garden and palace on the summit. According to this theory, King Kasyapa sought out an unassailable new residence after overthrowing and murdering his own father, King Dhatusena of Anuradhapura. After 16 years on the throne Kasyapa eventually took his own life on the battlefield, following the return of his vengeful half-brother.

After the 14th century the complex was abandoned. British archaeologist HCP Bell rediscovered the ruins in 1898, which were further excavated by British explorer John Still in 1907.

Unesco declared Sigiriya a World Heritage Site in 1982.