Modi said while strolling on the beach, he got lost in "conversation" with the ocean.
"This conversation carries the world of my feelings. I am sharing the feeling with you in the form of a poem," he wrote on Twitter in Hindi on Sunday.
Modi on Saturday had released a three-minute video of his plog on the beach where he was seen collecting waste and urged the people to ensure that public places are clean and tidy.
In the eight-paragraph signed poem, Modi describes the ocean's relationship with the sun, the waves, and its pain.
His collection of poems titled "A Journey" is already available.