The Karkota Dynasty (c. 625 − 855 CE) ruled over the Kashmir valley and some northern parts of the Indian subcontinent during 7th and 8th centuries. Their rule saw a period of political expansion, economic prosperity and emergence of Kashmir as a centre of culture and scholarship. The Karkota rulers constructed several shrines to Vishnu in their dominions. They however also allowed Buddhism to flourish under them. Stupa, Chaitya and Vihara can be found in the ruins of their capital. Martand Sun Temple in the Anantnag district were built by Lalitaditya. It is the oldest known Sun temple in India and was also one of the biggest temple complexes at the time. Avanti Varman ascended the throne of Kashmir in 855, establishing the Utpala dynasty and ending the rule of Karkota dynasty. The Nilamata Purana, believed to have been commissioned by Durlabhavardhana, the first ruler of the dynasty, provides information on contemporary affairs. However, not only that the Purana was penned to reconstruct Kashmir as one of the most sacred space in the subcontinental cosmos by attributing Brahminical divinity to its geographical features and then, establish Durlabhavardhana as its rightful king but also that there have been interpolations as late as the 10th century, the text cannot be treated as objectivist history. The Vishnudharmottara Purana is another local and contemporary source; it played similar roles in the Karkota polity. Other sources include the chronicles of a multitude of Buddhist pilgrims—Xuanzang (May 631−April 633), Yijing (673−685), Wukong, Hyecho and others—who visited Kashmir during the dynasty. The Kuttanimata, penned by a court-poet of Jayapida, was a didactic work on erotics but gave a lively account of contemporary Kashmiri life. The Rajatarangini, an 11th-century work by Kalhana, was aimed at sketching an outline of Kashmir's history since ancient times, and it did discuss the Karkota dynasty in depth. Kalhana depended on a variety of material including earlier historical works, dynastic genealogies, inscriptions, coins and Puranas.