He institutionalized the Khalsa (literally, Pure Ones), who played the key role in protecting the Sikhs long after his death, such as during the nine invasions of Panjab and holy war led by Ahmad Shah Abdali from Afghanistan between 1747 and 1769.