Prince Mahanama, of the Shakya clan and a cousin of Buddha, had great faith in the teachings of Buddha and was one of his most faithful followers.
At that time a violent king named Virudaka of Kosala conquered the Shakya clan. Prince Mahanama went to the King and sought the lives of his people, but the King would not listen to him. He then proposed that the King would let as many prisoners escape as could run away while he himself remained underwater in a near-by pond.
To this the King assented, thinking that the time would be very short for him to be able to stay underwater.
The gate of the castle was opened as Mahanama dived into the water and the people rushed for safety. But Mahanama did not come up, sacrificing his life for the lives of his people by tying his hair to the underwater root of a willow tree.