Sri Maharaja Rakai Kayuwangi Dyah Lokapala Sri Sajjanotsawatunggadewa was the seventh monarch of the Medang Kingdom of Central Java period (commonly referred as Mataram Kingdom) who ruled between 856 and 885. He is commonly known as Dyah Lokapala, King Lokapala, or Rakai Kayuwangi. King Lokapala was described as a valiant king that defeated his enemies.: 158
Rakai Kayuwangi was the youngest son of Rakai Pikatan from his queen consort Pramodawardhani.: 158 His name at birth was Dyah Lokapala (according to the Wantil or Shivagrha inscription inscription) or Mpu Lokapala (according to the Argapura inscription). In the Mantyasih inscription dated to 907, he is named as Rakai Kayuwangi.
The name Lokapala is probably linked to the Lokapala, the Hindu guardian gods of directions. Loka means place, while pala means fruit. The name kayuwangi literally means "fragrant wood" which refers to aromatic sandalwood, a fragrant wood considered as a valuable timber in ancient Java. The name Rakai Kayuwangi is actually a title. Historians suggest that before he ascended to become Maharaja of Java, Prince Lokapala was the Rakai (ancient Javanese title equate to Lord or Duke) of Kayuwangi province.
According to the Shivagrha inscription issued by King Lokapala on 12 November 856, he inaugurated a grand Shiva temple which is identified by historians as the Prambanan temple compound.: 20 According to this inscription, the temple was built to honor Lord Shiva, and its original name was Shiva-grha (the House of Shiva).
According to the Shivagrha inscription, Dyah Lokapala was chosen as the successor of his father, namely Sang Jatiningrat, which was the title Rakai Pikatan had assumed after he abdicated and retreated as a brahmin. The eldest child of Pikatan and Pramodhawardhani was Rakai Gurunwangi Dyah Saladu. However, despite being the eldest, Gurunwangi was not selected as Pikatan's successor. It was Lokapala, the youngest son, that was promoted as the royal successor, because of his heroic merits in defeating his father's enemies, who made a stronghold on the hill of Ratu Boko.: 159 King Lokapala reigned for about 30 years, and was succeeded by Dyah Tagwas in 885.
- Risa Herdahita Putri (2019-05-31). "Berebut Takhta Mataram Kuno". Historia - Majalah Sejarah Populer Pertama di Indonesia (in Indonesian). Retrieved 2020-12-30.
- Marwati Djoened Poesponegoro; Nugroho Notosusanto (2008). Sejarah Nasional Indonesia: Zaman Kuno (in Indonesian). Balai Pustaka. ISBN 978-9794074084. OCLC 318053182.
- "Prasasti Peninggalan Sejarah Kerajaan Mataram Kuno". KOMPAS.com (in Indonesian). 2 September 2020. Retrieved 2020-12-30.
- Taufiq. "Pendidikan Humaniora Jadi Prioritas Kerajaan Mataram Kuno sejak Didirikan di Temanggung". Majalah Kagama Online (in Indonesian). Retrieved 2020-12-30.
- Tjahjono Prasodjo; Thomas M. Hunter; Véronique Degroot; Cecelia Levin; Alessandra Lopez y Royo; Inajati Adrisijanti; Timbul Haryono; Julianti Lakshmi Parani; Gunadi Kasnowihardjo; Helly Minarti (2013). Magical Prambanan. Yogyakarta: PT (Persero) Taman Wisata Candi Borobudur, Prambanan & Ratu Boko. ISBN 978-602-98279-1-0.