The term Khālsā (, ) refers to both a community that follows Sikhism as its religion,Khalsa: Sikhism, Encyclopaedia Britannica as well as a special group of initiated Sikhs. The Khalsa tradition was initiated in 1699 by the Tenth Guru of Sikhism, Guru Gobind Singh. Its formation was a key event in the history of Sikhism. The founding of Khalsa is celebrated by Sikhs during the festival of Vaisakhi., Quote: "Vaisakhi is the most important mela. It marks the Sikh New Year. At Vaisakhi, Sikhs remember how their community, the Khalsa, first began."Cole, p. 63: "The Sikh new year, Vaisakhi, occurs at Sangrand in April, usually on the thirteenth day.", Quote: "(...) for the Sikhs, it [Baisakhi] celebrates the foundation of the Khalsa in 1699."

Guru Gobind Singh started the Khalsa tradition after his father, Guru Tegh Bahadur, was beheaded during the rule of the Mughal emperor Aurangzeb after the Hindu Brahmins had sought his aid to save their religion. Guru Gobind Singh created and initiated the Khalsa as a warrior with a duty to protect the innocent from religious persecution. The founding of the Khalsa started a new phase in the Sikh tradition. It formulated an initiation ceremony (amrit sanskar, nectar ceremony) and rules of conduct for the Khalsa warriors. It created a new institution for the temporal leadership of the Sikhs, replacing the earlier Masand system. Additionally, the Khalsa provided a political and religious vision for the Sikh community.

Upon initiation, a male Sikh was given the title of Singh meaning "lion". Kaur was made the sole, compulsory identifier for female Sikhs in the twentieth century. The rules of life include a behavioural code called Rahit. Some rules are no tobacco, no intoxicants, no adultery, no Kutha meat, no modification of hair on the body, and a dress code (Five Ks).

While originally a distinct subset of Sikhs, today the dilineation between Khalsa Sikhs and the wider, mainstream Sikh community has become blurred and muddled, despite most Sikhs not being formally ordained into the Khalsa order as Amritdharis. Most Sikhs hold the Khalsa institution in high-regard as the ultimate stage of a Sikh that serious Sikhs should aspire to become.

Etymology The term khālsā, is derived from the Arabic word k͟hālis which means "to be pure, to be clear, to be free from, to be sincere, to be true, to be straight, to be solid".Jain, S. (1994) Annals of the Bhandarkar Oriental Research Institute, Vol. 74, p. 217: The word "Khalsa" (from Persian Khalis) itself means "pure".

Sikhism emerged in the northwestern part of the Indian subcontinent (now parts of Pakistan and India). During the Mughal empire rule, according to professor Eleanor Nesbitt, Khalsa originally meant the land that was possessed directly by the emperor, which was different from jagir land granted to lords in exchange for a promise of loyalty and annual tribute to the emperor.

Prior to Guru Gobind Singh, the religious organization was organized through the masands or agents. The masands would collect revenue from rural regions for the Sikh cause, much like jagirs would for the Islamic emperor. The Khalsa, in Sikhism, came to mean pure loyalty to the Guru, and not to the intermediary masands who were increasingly becoming corrupt, states Nesbitt.Nesbitt, pp. 54–57, 29, 143

Background The word "Khalsa" as used by Sikhs first finds mentions in the hukamnamas issued during the guruship tenure of Guru Hargobind, where he references the congregation of the east as being the "Khalsa of the guru". A later hukamnama issued by Guru Tegh Bahadur refers to the local Sikh congregation of Pattan Farid as being 'Guru ji ka Khalsa' ("Khalsa of the guru"). In a hukamnama of Guru Gobind Singh dated to 25 April 1699, he refers to a congregation of local Sikhs of Bhai Gurdas Bhagte Phaphre village as 'sangat sahlang', with the 'sahlang' term being a different designation from that of a Khalsa. According to the Dabestan-e Mazaheb, the 'sahlang' term referred to person(s) initiated into the Sikh religion by a masand, who acted as representatives on behalf of the Sikh gurus. Such Sikhs were termed as meli or masandia, and were differentiated from Sikhs who had received their initiation rites directly from a Sikh guru, whom were termed as Khalsa. Whilst extant hukamnamas of Guru Gobind Singh from the period of 1699 to 1707 refer to local Sikh congregations or individual Sikhs as being the guru's Khalsa (often with the phrase 'Sarbat sangat mera Khalsa hai' meaning "the entire congregation is my Khalsa"), with the coming of the end of a personal guruship, Guru Gobind Singh would then issue a hukamnama to the Sikh congregation of Varanasi on 3 February 1708 that referred to them as being 'Waheguru ji ka Khalsa ("Khalsa of Waheguru").

The term Khalsa in Sikhism predates the events of Vaisakhi in 1699. Before the formalization of the Khalsa Panth in April 1699, the term Khalsa referred to a very special Sikh who was held in high esteem and considered as being close to the Guru. The Khalsa Panth's formalization in 1699 essentially opened this restricted class of Sikhs as a possibility to attain for the wider congregation. During the period of Banda Singh Bahadur, two extant hukamnamas of Banda that were issued to the Sikh congregations of Bhai Rupa and Jaunpur refer to them as being 'Akal Purakh jio da Khalsa' (meaning "the Khalsa of the Immortal Being"). With the later hukamnamas of Guru Gobind Singh's widowed wives, Mata Sundari and Mata Sahib Devan, of which there are around a dozen issued variously between the years 1717–1732, the Khalsa is also described as belonging to the supreme god, termed as Akal Purakh. By the time the Akal Takht began to issue hukamnamas, referring to itself as Sat Sri Akal Purakh ji ka Khalsa', the phrase 'Waheguru ji ka Khalsa' had already been established in common Sikh parlence to refer to specific people or a collective.

The Sikhs faced religious persecution during the Mughal Empire rule. Guru Arjan Dev, the fifth Guru, was arrested and executed by Mughal Emperor Jahangir in 1606. The following Guru, Guru Hargobind formally militarised the Sikhs and emphasised the complementary nature of the temporal power and spiritual power. In 1675, Guru Tegh Bahadur, the ninth Guru of the Sikhs and the father of Guru Gobind Singh was executed by the Mughal emperor Aurangzeb for resisting religious persecution of non-Muslims, and for refusing to convert to Islam. Guru Gobind Singh's sons were killed since they refused to convert to Islam., Quote: "The Guru's stance was a clear and unambiguous challenge, not to the sovereignty of the Mughal state, but to the state's policy of not recognizing the sovereign existence of non-Muslims, their traditions and ways of life".Singh, pp. 236–238 The Dadupanthis had a tradition that was known as Khalsa, being inspired by the Sikh tradition.

According to Louis E. Fenech, militant/armed ascetics and mahants were prevalent in 17th and 18th century India. Some prominent sects that were militant/armed were the Udasis, Dasnamis, Dadupanthis, Sanyasis, Fakirs, Ramanandis, and Naga-Gosains, whom according to 18th century Sikh accounts were amicable to the tenth Sikh guru. Guru Gobind Singh hired some of these militant ascetics for defensive purposes but doubted their loyalty. One account recalls that the Udasi ascetic Kirpal Das participated in the Battle of Bhangani in 1688 with the Sikhs against the Pahari rajas. Thus, the Khalsa tradition was inaugurated to produce an amalgamation of the nirgun bhakti of the Ramanandis and the militant asceticism of the Ramanandis and Naga-Gosains. Therefore the institution is a mixture of miri-piri, shakti, and bhakti, allowing Sikhs to be transformed into loyal sant-sipahis.

Evidence found within Bhai Jaita's Sri Gur Katha suggest that the title Singh was used by the Sikhs in the period leading up to the Battle of Bhangani, with the guru officiating the title for the Sikhs with the formalization of the Khalsa, popularly accepted as occurring in the year 1699. However, 1699 as the year when the Khalsa was formed only became popularly accepted due to a late 19th century work by Giani Gian Singh. The early 18th century Sikh sources place the year that the Khalsa was founded between 1695 and 1698, with Koer Singh Kalal stating it occurring in 1689. Furthermore, an inscribed copper-plate (tamar patar) dated to 1679 issued by Guru Gobind Singh to Jawala Das Brahman of a Shaivist temple in Kapal Mochan discusses the Khalsa and suffixes the guru's name with Singh. Thus, Raj Kumar Hans divides the creation of the Khalsa into two phases based upon Bhai Jaita's work:

Pre-Bhangani phase, where a large congregation of the Sikhs (invited from local and distant areas) was held at the Damdama at Anandpur, with a select few Sikhs starting to use Singh as a title and the Panj Piare consisted of a group of five Sikhs who answered the guru's call (with both aspects to martialize the Sikhs to prepare them for the upcoming battles), the guru also adopted the title of Singh. He dates this phase to between 1676–78. Post-Bhangani phase, after a series of successful battles where the Singhs and Panj Piare prove itself worthy, these aspects were popularized and standardized with the introduction of the Amrit Sanchar initiation ceremony, finalizing the Khalsa, which he places in around 1689.

Hans states that Guru Gobind Singh was motivated to found the Khalsa due to no Sikh taking action and remaining idle during the execution of his father in Delhi, with the Sikhs not standing out from the rest of the general population and not identifiable as separate. Thus, the guru contemplated a way to transform the Sikhs into intellectual-warriors, donning the 5Ks to give them a distinct appearance.

Foundation

As per the popular account, in the year 1699, the tenth Guru of Sikhism, Guru Gobind Singh asked Sikhs to gather at Anandpur Sahib on 13 April 1699, the day of Vaisakhi, the annual harvest festival. Guru Gobind Singh addressed the congregation from the entryway of a tent pitched on a hill, now called Kesgarh Sahib. He drew his sword, according to the Sikh tradition, and then asked for a volunteer from those who gathered, someone willing to sacrifice his head. One came forward, whom he took inside a tent. The Guru returned to the crowd without the volunteer, but with a bloody sword.

He asked for another volunteer and repeated the same process of returning from the tent without anyone and with a bloodied sword four more times. After the fifth volunteer went with him into the tent, the Guru returned with all five volunteers, all safe. Rather, the Guru had slaughtered 5 goats from which the blood had appeared. He called the volunteers the Panj Pyare and the first Khalsa in the Sikh tradition. These five volunteers were: Daya Ram (Bhai Daya Singh), Dharam Das (Bhai Dharam Singh), Himmat Rai (Bhai Himmat Singh), Mohkam Chand (Bhai Mohkam Singh), and Sahib Chand (Bhai Sahib Singh).

Guru Gobind Singh then mixed water and sugar into an iron bowl, stirring it with a double-edged sword while reciting Gurbani to prepare what he called Amrit ("nectar"). He then administered this to the Panj Pyare, accompanied by recitations from the Adi Granth, thus founding the khanda ki pahul (baptism ceremony) of a Khalsa – a warrior community.Dhavan, p. 49. After the first five Khalsa had been baptized, the Guru asked the five to baptize him as a Khalsa. This made the Guru the sixth Khalsa, and his name changed from Guru Gobind Rai to Guru Gobind Singh.

Around 80,000 men were initiated into the Khalsa order in a few days after its formalization on 13 April 1699.