Apart from one destructive sacking of Kathmandu in the early 13th century, Nepal remains largely untouched by the Muslim invasion of India that began in the 11th century. However, the Mughal period saw an influx of high-caste Hindus from India into Nepal. They soon intermingled with the Khas people and by the 16th century, there were about 50 Rajput-ruled principalities in Nepal, including the 22 (Baisi) states and, to their east in west-central Nepal, 24 ''Chaubisi'' states. There emerged a view that Nepal remained the true bastion of unadulterated Hinduism at a time when Indian culture had been influenced by centuries of Mughal, followed by British rule. Gorkha, one of the Baisi states, emerged as an influential and ambitious kingdom with a reputation for justice, after it codified the first Hinduism-based laws in the Nepalese hills.