Hinduism ascended, and Sanskrit is believed to have been the lingua franca of the locals during this time. By the time of the Muslim conquests (), the population in the region was predominantly Hindu, though Buddhism persisting in the valley until the 10th century, after which the area became largely Muslim. Hindu Shahi rulers built fortresses to guard and tax the commerce through this area, and ruins dating back to their rule can be seen on the hills at the southern entrance of Swat, at the Malakand Pass. Muslim rule Around 1001 CE, the last Hindu Shahi king, Jayapala was decisively defeated at the Battle of Peshawar (1001) by Mahmud of Ghazni, thereby ending 2 centuries of Hindu rule over Gandhara. Sometime later, ethnic Swatis entered the area along with Sultans from Kunar (present-day Afghanistan). In the 1500s, the Swat valley became occupied by Yusufzai Afghans and Islam became the dominant religion of the region. Yousafzai State of Swat The Yousafzai State of Swat was a kingdom established in 1849 by the Muslim saint Akhund Abdul Gaffur, more commonly known as Saidu Baba, that was ruled by chiefs known as Akhunds. It was then recognized as a princely state in alliance with the British Indian Empire between 1926 and 1947, after which the Akhwand acceded to the newly independent state of Pakistan. Swat continued to exist as an autonomous region until it was dissolved in 1969, and incorporated into Khyber Pakhtunkhwa Province (formerly called NWFP). Taliban destruction of Buddhist relics The region was seized by the Tehrik-i-Taliban in late-2007, and its highly-popular tourist industry was subsequently decimated until Pakistani control was re-established in mid-2009 after a month-long campaign. During their occupation, the Taliban attacked Nobel laureate Malala Yousafzai in 2012, who at the time was a young school-girl who wrote a blog for BBC Urdu detailing life under Taliban rule, and their curb on girls' education. Kushan-era Buddhist stupas and statues in the Swat Valley were demolished by the Taliban, and the Jehanabad Buddha's face was blown up using dynamite, but was repaired by a group of Italian restorers in a nine-year-long process. The Taliban and looters subsequently destroyed many of Pakistan's Buddhist artifacts, and deliberately targeted Gandhara Buddhist relics for destruction. Gandhara artifacts remaining from the demolitions were thereafter plundered by thieves and smugglers. Economy Approximately 38% of economy of Swat depends on tourism and 31% depends on agriculture.