Guru Tegh Bahadur was brought to Delhi as a prisoner, and kept in a lock-up at Chandni Chowk. Aurangzeb ordered Guruji to be brought before him in court. He then asked him to show some of his miracles, so that he could be convinced to the Guru's superior powers. But Guruji declined, saying that only pirs show miracles and since he was just a fakir devoted to, and having faith in, the Almighty he would not be able to please the emperor.
Aurangzeb then warned him that there were charges of treason against him which could be overlooked if he accepted Islam. But the Guru again replied that a faith which did not tolerate other faiths was no faith at all and that he was willing to suffer any punishment, but he would not change his dharma at any cost.
Aurangzeb then tried to tempt Guruji with an exalted position in this court. He also offered him rewards and jagir, but Guruji refused, saying that a religion forced out of fear or greed was nothing but tyranny. The emperor, angry at being disputed, ordered that the Guru be subjected to bodily tortures. Again, the emperor tried to persuade the Guru to change his religion but he refused, saying that both religions could exist side by side. The emperor sent the Guru to the lockup again, where he was tortured more ruthlessly than before. The Guru, somehow, managed to sent a letter to Anandpur in which he openly declared his decision to sacrifice his life for the sake of his dharma and righteousness. He also asked Gobindji to be brought up well.
The Guru and his disciples continued to be imprisoned with many guards posted outside. One day, Guruji received a letter from Anandpur in which he could feel the sorrow and grief of his family. He now realized that the time of his death was fast approaching, and he must now appoint Gobind Singh as the new Guru. He sent Bhai Gurditta to Anandpur with a five paisa coin and a coconut to instal Gobindji as the tenth Guru.
After giving the Guruji a few days to think over, Aurangzeb offered conversion again, but Guruji declined. The emperor was surprised at the boldness and courage of the Guru, and resolved to break it. He decided to punish Guruji's disciples to pulverize the Guru by showing him the sad fate of his disciples, and thus make him accept Islam out of fear.
Baba Matidas, Guruji's close disciple, was the first one ordered to be executed. Before dying , he was given a choice to embrace Islam or die. Mati Das happily chose death. Before Guruji's own eyes, Mati Das was cut in two by a wood cutting blade. Bhai Dayal Das was made to sit in boiling water, but he did not forsake his faith either. Bhai Satidas's body was also cut into pieces, but he too did not accept the conversion of his faith. Bhai Guruditta was caught by the soldiers while attempting an escape. He was put behind bars, and strict security was placed around him.
Guru Tegh Bahadur was asked for the last time if he was willing to convert himself. He refused and the order of execution was passed.
It was November 11, 1675, when Guruji was taken out of the iron cage for execution. He had his bath, and chanted the name of Japji, sitting beneath a tree. After saying his prayers he got up and told the executioners that he was ready for the sacrifice, and that the emperor's ordered should be carried out.
The vast multitude of people stood still, numb with grief and helplessness. The Guru raised his hands, and blessed them. the executioner then brought his sword down, and the Guru's head fell into the lap of Bhai Jaitaji. At that moment, the whole firmament vibrated with a deafening noise and the sky became overcast with black clouds. A great storm blew in the city, and filled every body's eyes with dust. In this confusion, Bhai Jaitaji stealthily carried the only head to Anandpur. The Guru's trunk continued to lie in the dungeon for sometime but was quietly and ingeniously taken out by a devotee, Lakhi Shah, to his house in Raisana. There the house was instantly set fire, before there was any interference from the Mughal court. Early next morning, the ashes were collected, put in a proper urn and buried there. In this manner, Guru Tegh Bahadur sacrificed his life and saved his dharma.