Rishi Valmiki was walking along the banks of River Thamasa. The clear water of the river, the verdant forest and the cool breeze filled his mind with inexplicable calm. He was at peace with the world, praying for the welfare of all creation. That he had once been a hunter and robber, killing animals and torturing human beings, seemed like something from another birth.
There had been a time when he could not even pronounce the name of Rama and had to repeat the name of the tree ‘Maramara’. When he did so, the sound ‘Rama’ automatically formed itself. So deep was his meditation that he did not realize that he was covered by termites. When he opened his eyes, he was no more Ratnakar the hunter-robber, but Valmiki, the Rishi. (Vanmika in Sanskrit means- termite).

As he was walking, Valmiki noticed a pair of Krauncha birds (அனà¯à®±à®¿à®²à¯ பறவைகளà¯) sitting close to each other and conversing with their beaks. Valmiki smiled at the happy sight. Suddenly, an arrow flew straight into the body of the male bird. Drenched in blood and writing in agony, it fell at the sage’s feet before breathing its last. Valmiki was shaken, and he shivered in anger at the cruelty of the deed. What was the bird’s crime that it should be killed like this?

As he looked up, he saw a smiling hunter walk towards the fallen bird. A furious Valmiki cursed him.
"मा निषाद पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ां तà¥à¤µà¤®à¤—मः शाशà¥à¤µà¤¤à¥€à¤ƒ समाः।यतà¥à¤•à¥à¤°à¥Œà¤‚चमिथà¥à¤¨à¤¾à¤¦à¥‡à¤•मॠअवधीः काममोहितमà¥"
“Maa Nishada Pratistham Tvamagamah sÄsvati Samaa
Yat Kraunchamithunaadekam Avadhi Kaamamohitam.”
The curse meant -- O hunter! Don’t live long! You have caused the death of a male bird that was happy with its mate.
Strangely, even after he finished it, the words reverberated in the air.
They sounded good, and seemed to be set in a metre. That was the first time a verse had been formed with 32 letters; this later came to be called ‘Anushtyup metre’. Valmiki was wonderstruck. He could not understand what was happening.
Lord Brahma appeared in front of him, and said: “O Rishi! You have composed a magnificent shloka when you cursed that hunter. Listen to it again. If you arrange the words differently, it becomes a shloka that praises Lord Narayana and Sri Rama. It may also mean -- ‘O Abode of Mahalakshmi! May your glory remain for ever! You have brought an end to Ravana who was lustful.’
How lovely! Now, I give you an important task. You have to write a great epic, based on the story of Sri Rama, setting the shlokas in the same metre that came out of your mouth just now. I bestow you with the ability to know what passed in the minds of Rama, Sita and all the other characters in the Ramayana.”
“If that is the will of the Divine, so be it!” - Valmiki accepted the order with humility.
Strangely, just a few days before this, Valmiki had wondered if there existed a human being blessed with all the good qualities that could ever be thought of, when Devarishi Narada narrated Rama’s story to him in brief, assuring him that Lord Rama was a personification of all good qualities.
Valmiki realized that he was being used as an instrument for a monumental work. Otherwise, why would a curse become a shloka?
He had to compose a Mahakavya that would not only be read with interest by his contemporaries but would also be passed on to posterity. His magnum opus, when completed, came to be known as the ‘Adi Kavya’, the first epic. And, he is known as ‘Adi Kavi’, the first poet.
Valmiki’s Ramayana consists of 24,000 verses and six cantos -- BalaKanda, AyodhyaKanda, AranyaKanda, KishkindaKanda, SundaraKanda and YuddhaKanda.

Another interesting fact about this epic is that after every 1000th shloka, the next shloka begins with a letter from the Gayathri manthra. In fact, all such shlokas are collected together and read as ‘Gayathri Ramayana’!