The guru saves his disciple by using the king's own foolishness against him. He does not beg for mercy or argue that the disciple is innocent; instead he makes the king want to take the disciple's place.
Step 1: The guru reaches the disciple in time. The disciple, having grown fat on cheap food, is chosen to fit the new stake. While awaiting death he prays to his guru, who sees everything in a vision and arrives at once.
Step 2: The guru stages a quarrel. After whispering something to the disciple, the guru asks the king who is greater, the guru or the disciple. The king answers, "the guru." The guru then demands, "Put me to the stake first. Put my disciple to death after me." The disciple, understanding the plan, shouts that he should die first. Their fight over who should die first puzzles the king.
Step 3: The guru invents a tempting lie. The king asks why they are so eager to die. The guru takes him aside and whispers that the new stake is the stake of the god of justice: whoever dies on it first will be reborn as king of the country, and the next as minister. He claims that he and his disciple are tired of ascetic life and want these rewards, so the king must keep his promise and put the guru first.
Step 4: The king traps himself. The king does not want to lose his kingdom in the next life. He postpones the execution and consults his minister. Believing that "holy men do not tell lies," the two decide to go on the stake themselves so that they will be reborn as king and minister again.
Step 5: The swap and the outcome. That night the king and minister release the guru and disciple, disguise themselves as them, and are executed in their place. The people discover the dead bodies of the king and minister, and later beg the guru and disciple to rule. The guru agrees on condition that all the old laws be changed, so night becomes night and day becomes day again.
Thus the guru saves his disciple's life not by force but by wisdom: he turns the fools' greed and superstition against them, so that the intended victims escape and the foolish rulers destroy themselves.