After few years Mahesh Das decided to travel to emperor's court at Agra to seek his fortune. He had finished his studies and was ready to face the world. When he arrived at Agra， he walked through the bazaar of Agra， big havelis in which Nobles lived， it was all very confusing for a lad who have lived in the village. But Mahesh was no ordinary individual， he carried the emperor's ring in a bag and looked around with interest. By evening he reached the massive fort of emperor of Hindustan which was on the bank of river Yamuna. The huge wooden gate was open and important-looking people hurried in and out. Though Mahesh was a brave boy but he felt very small as he neared the enormous studded gate of the fort. Two guards stood outside holding the spears in their muscular hands. Mahesh went to them and said， “I have come to meet the emperor. he invited me to his court.”
“Ho！” said the sentry， looking at the Mahesh's dusty feet and simple cotton clothes. “So the emperor invited you to his durbar， did he？ To the Diwan-i-Khas， no doubt， the hall of Private Audience， where he meets high-ranking nobles！” A few passer by stopped to watch， smiling at the simple village lad's embarrassment.
“Perhaps”， answered Mahesh Das with bold voice though he was frightened from inside. “And I have his ring to prove it.” He took out the ring from his bag which emperor Akbar gave him. “Oh！”， said the guards， in sudden doubt.
“That's no ordinary ring， sorry to have lost an opportunity to bully and tease you. I'll let you go in on one condition， said one of the guard， When you see the emperor， he will sure give you a gift. I'll let you in if you swear to give me half of whatever the emperor gives you.”
People standing by began to murmur. They knew the greedy ways of the guard and wondered how the young man would deal with him. But their surprise Mahesh agreed to the guards condition without making any arguments or bargains. The guard said again threateningly， “don't forget or I'll make you feel very very sorry.”
Mahesh nodded and said， “I won't forget，” and walked in to the fort.
Emperor Akbar was in his Diwan-i-Aam， the hall of public Audience. Lamps lit up the carvings on the wall and rich carpets were spread on the floor. The great pillared hall was full of courtiers dressed in their finest and most beautifully woven clothes. But Mahesh Das had eye only for the emperor， who sat grandly on a platform at the far end of the hall. Bowing low， he made his way towards the throne. The courtiers murmured to each other in surprise. Who could this be？ But emperor happened to glance up. He recognised the young man at once and asked him to come forward. “I remember you， Mahesh Das，” said the emperor. “And I am pleased that you have come. Ask for anything your heart desires and it shall be yours.”
“Jahanpanah is most gracious，” Mahesh Das answered. “If Hazoor pleases， my dearest wish is to be given fifty lashes of the whip！”
“Mad， the boy must be mad，” people whispered to each other. But the emperor liked the bright， straight forward look in his eyes and he said， “Before we grant this strange wish you must tell us the reason for asking such a gift.”
Mahesh Das bowed once again and said， “ The sentry who guards the Jahapanah's fort permitted me to come in only on one condition that i will give him half of the gift which I receive from you. And I promised him to share it with him. I'm ready to bear twenty-five lashes， in order to share this with the guard.”
When Akbar heard this， he grew angry. “Are our people to be kept away by a greedy wicked guard？ he thundered. ”Send for that greedy guard.“
The guard was sentenced to the entire gift of fifty lashes and never again tied to bully people who sought an audience with the emperor. And Mahesh Das was given a place at the court， with all the comforts that went with it. “We confer on you the title Raja Birbal for this day on，” the emperor Akbar declared. “And you shall stay near us and amuse and guide us henceforth！” said the emperor.
Since then Mahesh Das got his name 'Birbal'.