 By the end of the 12th century, following the Muslim conquest of the Buddhist stronghold in Bihar, Buddhism, having already declined in the South, declined in the North as well because survivors retreated to Nepal, Sikkim and Tibet or escaped to the South of the Indian sub-continent.The Martand Sun Temple was built by the third ruler of the Karkota Dynasty, Lalitaditya Muktapida, in the 8th century CE.The temple was completely destroyed on the orders of the Muslim ruler Sikandar Butshikan in the early 15th century, with demolition lasting a year.