In 1017, the Iranian Islamic historian Al-Biruni was deported after a war that Mahmud of Ghazni won, to the northwest Indian subcontinent under Mahmud's rule. Al Biruni stayed in the region for about fifteen years, learnt Sanskrit, and translated many Indian texts, and wrote about Indian society, culture, sciences, and religion in Persian and Arabic. He stayed for some time in the Hindu Kush region, particularly near Kabul. In 1019, he recorded and described a solar eclipse in what is the modern era Laghman Province of Afghanistan through which Hindu Kush pass. Al Biruni also wrote about early history of the Hindu Kush region and Kabul kings, who ruled the region long before he arrived, but this history is inconsistent with other records available from that era. Al Biruni was supported by Sultan Mahmud. Al Biruni found it difficult to get access to Indian literature locally in the Hindu Kush area, and to explain this he wrote, "Mahmud utterly ruined the prosperity of the country, and performed wonderful exploits by which the Hindus became the atoms scattered in all directions, and like a tale of old in the mouth of the people. (...) This is the reason, too, why Hindu sciences have retired far from those parts of the country conquered by us, and have fled to places which our hand cannot yet reach, to Kashmir, Benares and other places".