The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"When no Attachment."--This story was told by the Master while at Jetavana, about a Brother who had given up all earnest effort.
Said the Master to him, "Is the report true, Brother, that you are a backslider?"
"Yes, Blessed One."
"In bygone days, Brother," said the Master, "the wise and good won a throne by their dauntless perseverance in the hour of need."
And so saying, he told this story of the past.
Once on a time when Brahmadatta was reigning in Benares, it was as his queen's child that the Bodhisatta came to life once more. On the day when he was to be named, the parents enquired as to their child's destiny from eight hundred brahmins, to whom they gave their hearts' desire in all pleasures of sense. Marking the promise which he shewed of a glorious destiny, these clever soothsaying brahmins foretold that, coming to the throne at the king's death, the child should be a mighty king endowed with every virtue; famed and renowned for his exploits with five weapons, he should stand peerless in all Jambudīpa 1.  And because of this prophecy of the brahmins, the parents named their son Prince Five-Weapons.
Now, when the prince was come to years of discretion, and was sixteen years old, the king bade him go away and study.
"With whom, sire, am I to study?" asked the prince.
"With the world-famed teacher in the town of Takkasilā in the Gandhāra country. Here is his fee," said the king, handing his son a thousand pieces.
So the prince went to Takkasilā and was taught there. When he was leaving, his master gave him a set of five weapons, armed with which, after bidding adieu to his old master, the prince set out from Takkasilā for Benares.
On his way he came to a forest haunted by an ogre named Hairy-grip; and, at the entrance to the forest, men who met him tried to stop him, saying: "Young brahmin, do not go through that forest; it is the haunt
of the ogre Hairy-grip, and he kills every one he meets." But, bold as a lion, the self-reliant Bodhisatta pressed on, till in the heart of the forest he came on the ogre. The monster made himself appear in stature as tall as a palm-tree, with a head as big as an arbour and huge eyes like bowls, with two tusks like turnips and the beak of a hawk; his belly was blotched with purple; and the palms of his hands and the soles of his feet were blue-black! "Whither away?" cried the monster. "Halt! you are my prey." "Ogre," answered the Bodhisatta, "I knew what I was doing when entering this forest. You will be ill-advised to come near me. For with a poisoned arrow I will slay you where you stand." And with this defiance, he fitted to his bow an arrow dipped in deadliest poison and shot it at the ogre. But it only stuck on to the monster's shaggy coat. Then he shot another and another, till fifty were spent, all of which merely stuck on to the ogre's shaggy coat. Hereon the ogre, shaking the arrows off so that they fell at his feet, came at the Bodhisatta; and the latter, again shouting defiance, drew his sword and struck at the ogre. But, like the arrows, his sword, which was thirty-three inches long, merely stuck fast in the shaggy hair. Next the Bodhisatta hurled his spear, and that stuck fast also. Seeing this, he smote the ogre with his club; but, like his other weapons, that too stuck fast. And thereupon the Bodhisatta shouted, "Ogre, you never heard yet of me,  Prince Five-Weapons. When I ventured into this forest, I put my trust not in my bow and other weapons, but in myself! Now will I strike you a blow which shall crush you into dust." So saying, the Bodhisatta smote the ogre with his right hand; but the hand stuck fast upon the hair. Then, in turn, with his left hand and with his right and left feet, he struck at the monster, but hand and feet alike clave to the hide. Again shouting "I will crush you into dust!" he butted the ogre with his head, and that too stuck fast.
Yet even when thus caught and snared in fivefold wise, the Bodhisatta, as he hung upon the ogre, was still fearless, still undaunted. And the monster thought to himself, "This is a very lion among men, a hero without a peer, and no mere man. Though he is caught in the clutches of an ogre like me, yet not so much as a tremor will he exhibit. Never, since I first took to slaying travellers upon this road, have I seen a man to equal him. How comes it that he is not frightened?" Not daring to devour the Bodhisatta offhand, he said, "How is it, young brahmin, that you have no fear of death?"
"Why should I?" answered the Bodhisatta. "Each life must surely have its destined death. Moreover, within my body is a sword of adamant, which you will never digest, if you eat me. It will chop your inwards into mincemeat, and my death will involve yours too. Therefore it is that I have no fear." (By this, it is said, the Bodhisatta meant the Sword of Knowledge, which was within him.)
Hereon, the ogre fell a-thinking. "This young brahmin is speaking the truth and nothing but the truth," thought he. "Not a morsel so big as a pea could I digest of such a hero. I'll let him go." And, so, in fear of his life, he let the Bodhisatta go free, saying, "Young brahmin, you are a lion among men; I will not eat you. Go forth from my hand, even as the moon from the jaws of Rāhu, and return to gladden the hearts of your kinsfolk, your friends, and your country."
"As for myself; ogre," answered the Bodhisatta, "I will go. As for you, it was your sins in bygone days that caused you to be reborn a ravening, murderous, flesh-eating ogre; and, if  you continue in sin in this existence, you will go on from darkness to darkness. But, having seen me, you will be unable thenceforth to sin any more. Know that to destroy life is to ensure re-birth either in hell or as a brute or as a ghost or among the fallen spirits. Or, if the re-birth be into the world of men, then such sin cuts short the days of a man's life."
In this and other ways the Bodhisatta sheaved the evil consequences of the five bad courses, and the blessing that conies of the five good courses; and so wrought in divers ways upon that ogre's fears that by his teaching he converted the monster, imbuing him with self-denial and establishing him in the Five Commandments. Then making the ogre the fairy of that forest, with a right to levy dues 1, and charging him to remain steadfast, the Bodhisatta went his way, making known the change in the ogre's mood as he issued from the forest. And in the end he came, armed with the five weapons, to the city of Benares, and presented himself before his parents. In later days, when king, he was a righteous ruler; and after a life spent in charity and other good works he passed away to fare thereafter according to his deserts.
This lesson ended, the Master, as Buddha, recited this stanza:--
When he had thus led his teaching up to Arahatship as its crowning point, the Master went on to preach the Four Truths, at the close whereof that Brother won Arahatship. Also, the Master showed the connexion, and identified the Birth by saying, "Aṅgulimāla 3 was the ogre of those days, and I myself Prince Five-Weapons."
137:1 This was one of the four islands, or dipā, of which the earth was supposed to consist; it included India, and represented the inhabited world to the Indian mind.
139:1 Or, perhaps, "to whom sacrifices should be offered." The translation in the text suggests a popular theory of the evolution of the tax-collector. See also No. 155.
139:2 See Nos. 56 and 156.
139:3 Aṅgulimāla, a bandit who wore a necklace of his victims' fingers, was converted by the Buddha and became an Arahat. Cf. Majjhima Nikāya No. 86.