The Jataka, Vol. II, tr. by W.H.D. Rouse, , at sacred-texts.com
"If any man," etc.--This story the Master told while staying at Jetavana, about Devadatta.
It was occasioned by something that happened at Rājagaha. At one period the Captain of the Faith was living with five hundred brethren at the Bamboo Grove. And Devadatta, with a body of men wicked like himself, lived at Gayāsīsa.
At that time the citizens of Rājagaha used to club together for the purpose of almsgiving. A trader, who had come there on business, brought a magnificent perfumed yellow robe, asking that he might become one of them, and give this garment as his contribution. The townspeople brought plenty of gifts. All that was contributed by those who had clubbed together consisted of ready money. There was this garment left. The crowd which had come together said, "Here is this beautiful perfumed robe left over. Who shall have it--Elder Sāriputta, or Devadatta?" Some were in favour of Sāriputta; others said, "Elder Sāriputta will stay here a few days,  and then go travelling at his own sweet will; but Devadatta always lives near our city; he is our refuge in good fortune or ill. Devadatta shall have it!" They made a division, and those who voted for Devadatta were in the majority. So to Devadatta they gave it. He had it cut in strips, and sewn together, and coloured like gold, and so he wore it upon him.
At the same time, thirty Brethren went from Sāvatthi to salute the Master. After greetings had been exchanged, they told him all this affair, adding, "And so, sir, Devadatta wears this mark of the saint, which suits him ill enough." "Brethren," said the Master, "this is not the first time that Devadatta has put on the garb of a saint, a most unsuitable dress. He slid the same before." And then he told them an old-world tale.
Once upon a time, when Brahmadatta was king of Benares, the Bodhisatta came into this world as an Elephant in the Himalaya region.
[paragraph continues] Lord of a herd that numbered eighty thousand wild elephants, he dwelt in the forest land.
A poor man that lived in Benares, seeing the workers of ivory in the ivory bazaar making bangles and all manner of ivory trinkets, he asked them would they buy an elephant's tusks, if he should get them. To which they answered, Yes.
So he took a weapon, and clothing himself in a yellow robe, he put on the guise of a Pacceka-Buddha 1, with a covering band about his head. Taking his stand in the path of the elephants, he slew one of them with his weapon, and sold the tusks of it in Benares; and in this manner he made a living. After this he began always to slay the very last elephant in the Bodhisatta's troop. Day by day the elephants grew fewer and fewer. Then they went and asked the Bodhisatta how it was that their numbers dwindled. He perceived the reason. "Some man," thought he, "stands in the place where the elephants go, having made himself like a Pacceka-Buddha in appearance. Now can it be he that slays the elephants? I will find him out." So one day he sent the others on before him  and he followed after. The man saw the Bodhisatta, and made a rush at him with his weapon. The Bodhisatta turned and stood. "I will beat him to the earth, and kill him!" thought he: and stretched out his trunk,--when he saw the yellow robes which the man wore. "I ought to pay respect to those sacred robes!" said he. So drawing back his trunk, he cried--"O man! Is not that dress, the flag of sainthood, unsuitable to you? Why do you wear it?" and he repeated these lines:
He who has speed out sin, who everywhere
Is firm in virtue, and whose chiefest care
Is to control his passions, and be true,
He well deserves the yellow robe to wear."
 With these words, the Bodhisatta rebuked the man, and bade him never come there again, else he should die for it. Thus he drove him away.
After this discourse was ended, the Master identified the Birth:--"Devadatta was the man who killed the elephants, and the head of the herd was I."
139:1 One who has attained the knowledge needful for attaining Nirvana, but does not preach it to men.