The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"Now scorched."--This story the Master told while at Pāṭikārāma near Vesāli, about Sunakkhatta.
For at that time Sunakkhatta, having become an adherent of the Master, was travelling about the country as a Brother with bowl and robes, when he was perverted to the tenets of Kora the Kshatriya 1. So he returned to the Blessed Buddha his bowl and robes-and reverted to a lay life by reason of Kora the Kshatriya, about the time when this latter had been re-born as the offspring of the Kālakañjaka Asura. And he went about within the three walls of Vesāli defaming the Master by affirming that there was nothing superhuman about the sage Gotama, who was not distinguished from other men by preaching a saving faith; that the sage Gotama had simply worked out a system which was the outcome of his own individual thought and study; and that the ideal for the attainment of which his doctrine was preached, did not lead to the destruction of sorrow in those who followed it 2.
Now the reverend Sāriputta was on his round for alms when he heard Sunakkhatta's blasphemies; and on his return from his round he reported this to the Blessed One. Said the Master, "Sunakkhatta is a hot-headed person, Sāriputta, and speaks idle words. His hot-headedness has led him to talk like this and to deny the saving grace of my doctrine. Unwittingly, this foolish person is extolling me; I say unwittingly, for he has no knowledge  of my efficacy. In me, Sāriputta, dwell the Six Knowledges, and herein am more than human; the Ten Powers are within me, and the Four Grounds of Confidence. I know the limits of the four types of earthly existence and the five states of possible re-birth after earthly death. This too is a superhuman quality in me; and whose denies it must retract his words, change his belief, and renounce his heresy, or he will without ado be cast into hell." Having thus magnified the superhuman nature and power which existed within him, the Master went on to say, "Sunakkhatta, I hear, Sāriputta, took delight in the misguided self-mortifications of the asceticism of Kora the Kshatriya; and therefore it was that he could take no pleasure in me. Ninety-one aeons ago I lived the higher life in ail its four forms 3, examining into that false asceticism to discover whether the truth abode therein. An ascetic was I, the chief of ascetics; worn and emaciated was I, beyond all others; loathing of comfort had I, a loathing surpassing that of all others; I dwelt apart, and unapproachable was my passion for solitude." Then, at the Elder's request, he told this story of the past.
Once on a time, ninety-one æons ago, the Bodhisatta set himself to examine into the false asceticism. So he became a recluse, according to the Naked Ascetics (Ājīvikas),--unclothed and covered with dust, solitary and lonely, fleeing like a deer from the face of men; his food was small
fish, cowdung, and other refuse; and in order that his vigil might not be disturbed, he took up his abode in a dread thicket in the jungle. In the snows of winter, he came forth by night from the sheltering thicket to the open air, returning with the sun-rise to his thicket again; and, as he was wet with the driving snows by night, so in the day time he was drenched by the drizzle from the branches of the thicket. Thus day and night alike he endured the extremity of cold. In summer, he abode by day in the open air, and by night in the forest--scorched by the blazing sun by day, and fanned by no cooling breezes by night, so that the sweat streamed from him. And there presented itself to his mind this stanza, which was new and never uttered before:--
 But when after a life spent in the rigours of this asceticism, the vision of hell rose before the Bodhisatta as he lay dying, he realised the worthlessness of all his austerities, and in that supreme moment broke away from his delusions, laid hold of the real truth, and was re-born in the Heaven of Devas.
His lesson ended, the Master identified the Birth by saying, "I was the naked ascetic of those days."
[Note. For the 'story of the past'? cf. Cariyā Piṭaka, p. 102. For the introductory story see Sutta No. 12 of the Majjhima Nikāya.]
229:1 See Hardy's Manual of Budhism, p. 330.
229:2 This is a quotation from the Majjhima Nikāya I. 68.
229:3 i.e. as a learner, householder, réligieux, and recluse.