Pushpadanta (literally, Flower-Teethed was a Gandharva), a celestial musician, in the court of Lord Indra(King of the Gods). Pushpadanta was also a devotee of Lord Shiva and a lover of flowers.
Once he happened to see a beautiful garden adorned with charming flowers. It was King Chitrarathas royal garden, who was also a devotee of Lord Shiva. The King used to offer flowers from his palatial garden as a symbol of his devotion to Lord Shiva.
Pushpadanta was so awestruck by the beauty of the garden, that he could not control his emotions and picked up the flowers from the garden. Every day he tried to stop himself, but failed and picked up the flowers. As a result, King Chitraratha was left with no flowers to complete his prayers to Lord Shiva.
The King did all he could to address the issue. But Pushpadanta had divine powers to be invisible and hence, the king could not find the culprit. Left with no ideas to solve this problem, the king spread bilva leaves or bilipatra (AEGLE MARMELOS tree leaves, which are considered to be sacred offerings to Lord Shiva) in his garden.
Pushpadanta was unaware of this and unknowingly stepped on the bilva leaves. This infuriated Lord Shiva and he punished Pushpadanta by taking away his divine powers.
He was shocked, but being a blessed devotee, he realized why that happened. In order to seek forgiveness and please Lord Shiva, Pushpadant composed a stotra (song of praise) in which he elaborated at length upon Shivas greatness as a prayer. Lord Shiva, was pleased with his prayers, absolved him and returned his divine powers. This very prayer became well known as the Shiva Mahimna Stotram.
Anyone who recites this hymn with a pure heart and devotion will be blessed with fame, wealth, long life and children