The Jataka, Vol. III, tr. by H.T. Francis and R.A. Neil, , at sacred-texts.com
"Thy gifts bestowed," etc.—This story the Master told while dwelling at Jetavana, about the Elder Ānanda. The circumstances that suggested the story have been already given. "In former days too," the Master said, "wise men acted on the principle that one good turn deserves another." And hereupon he told them a story of the olden time.
Once upon a time the Bodhisatta was king of Benares, and exercising his rule with justice and equity he gave alms and kept the moral law.
And being minded to quell some disturbance on his frontier he set out with a large force, but being defeated he mounted his horse and fled till he reached a certain border village. Now there dwelt here thirty loyal subjects and they were gathered together very early, in the middle of the village, to transact the business of the place. And at this moment the king mounted on his mail-clad horse and splendidly equipped  rode into the place by the village gate. The people were terrified and saying, "What can this be?" fled every man to his own home. But there was one man who without going to his own house, came to welcome the king. And telling the stranger that the king, he heard, had come to the frontier, he inquired who he was and whether he was a royalist or a rebel. " I am for the king, Sir," he said. " Then come with me," he answered, and led the king to his home and made him sit down on his own seat. Then the man said to his wife, "My dear, bathe our friend's feet;" and when she had so done, he offered him the best food he could, and had a bed made ready for him, bidding him rest awhile. So the king lay down. Then his host took off the armour from the horse, turned him loose, gave him water to drink and grass to eat and rubbed him down with oil. Thus did he tend the king for three or four days, and the king said, "Friend, I am now off," and again be did all due service both to the king and his horse. The king after he had taken food, on leaving said, "I am called the Great Horseman. Our home is in the centre of the city. Should you come there on any business, stand at the door on the right hand and ask the porter where the Great Horseman dwells, and take him with you and come to our house." With these words he departed.
Now the army, not seeing the king, remained encamped outside the town, but when they saw him, they came out to meet him and escorted him home. The king on entering the city stood at the entrance of the
gate and calling the porter ordered the crowd to retire and said, "Friend, a certain man who lives in a frontier village will come here, anxious to see us, and will ask where the house of the Great Horseman is. Take him by the hand and bring him into our presence, and then you shall receive a thousand pieces of money."
But when the man failed to come, the king increased the tax on the village where he dwelt. But though the tax was raised, still he did not come. So the king increased the tax for the second and third time, and still he came not. Then the inhabitants of the village gathered together and said to the man: " Sir, from the time the Horseman came to you,  we have been so weighed down by the tax that we cannot lift up our head. Go and see the Great Horseman and persuade him to lighten our burden."
"Well, I will go," he answered, "but I cannot go empty-handed. My friend has two sons: so get you ready ornaments and suits of clothes for them and for his wife and for my friend himself."
"Very well," they said, and got everything ready for a present.
So he took both this gift and a cake fried in his own house. And when he came to the door on the right hand he asked the porter where the house of the Great Horseman might be. The porter answered, "Come with me and I will shew you," and took him by the hand, and on arriving at the king's gate sent in word, "The porter has come and has brought with him the man who dwells in the border village." The king on hearing it, rose from his seat and said, "Let my friend and all that have come with him enter." Then he went forward to welcome him and embraced him, and after inquiring if his friend's wife and children were well, he took him by the hand, stepped on the dais and seated him on the royal throne beneath the white umbrella. And he summoned his chief consort and said, "Wash my friend's feet." So she washed his feet. The king sprinkled water from a golden bowl, while the queen washed his feet and anointed them with scented oil. Then the king asked, "Have you anything for us to eat?" And he said, "Yes, my lord," and brought out cakes in a bag. The king received them in a golden dish, and showing great favour towards him he said, "Eat what my friend has brought," and gave some to his queen and his ministers, and himself too ate of it. Then the stranger brought out his other gift. And the king to show that he accepted it put off his silken garments and put on the suit of clothes that he had brought him.  The queen also laid aside her silk dress and ornaments and put on the dress and ornaments he had brought her. Then the king served him with food fit for a king and bade one of his councillors, saying, "Go and see that his beard is trimmed after the fashion of my own, and let him bathe in scented water. Then dress him in a silken robe worth a hundred thousand pieces of money, and adorn him in royal style and bring him
here." This was done. And the king by beat of drum through the city gathered together his councillors, and throwing a thread of pure vermilion across the white umbrella, gave him the half of his kingdom. From that day they ate, drank and dwelt together and they became firm and inseparable friends.
Then the king sent for the man's wife and family and had a house built for them in the city, and they ruled the kingdom in perfect harmony. So the courtiers waxed wroth and said to the king's son, "O prince, the king has given the half of his kingdom to a certain householder. He eats and drinks and dwells with him, and orders us to salute his children. What service he has done the king we know not. What does the king mean? We feel ashamed. Do you speak to the king." He readily agreed to do so, and told every word to the king and said, "O great king, do not act thus."
" My son," he answered, "do you know where I dwelt after I was defeated in battle?" 1
"I know not, my lord," he said.
"I was living," said the king, "in this man's house, and when I had recovered my health I came back and reigned again. How then should I not bestow honour on my benefactor?"
And then the Bodhisatta went on to say, "My son, whosoever giveth to one unworthy of his gift, and to the deserving giveth nought, that man when he falls into misfortune findeth no one to help him." And to point the moral he uttered these verses:
In sorest need would bring no friend to save:
But grace or kindness to the good displayed
In sorest need would bring thee timely aid.
Boons to unworthy souls are spent in vain,
Thy smallest service to the good is gain:
A noble action though it stands alone,
Renders the doer worthy of a throne:
As fruit abundant from the tiny seed,
Eternal fame springs from a virtuous deed.
 On hearing this neither the councillors nor the young prince had aught to say in answer.
The Master, his discourse ended, thus identified the Birth: "At that time it was Ānanda who dwelt in the frontier village, while I myself was king of Benares."
8:1 Compare No. 157, vol. ii.