"Dear Chetan Bhagat, many happy returns of the day! Sharing the selfie you took last evening," Mr Modi posted on Tuesday.
Mr Bhagat, author of bestsellers like "Five Point Someone", "The 3 Mistakes Of My Life" and "2 States: The Story Of My Marriage", met the BJP's prime ministerial candidate on Monday.
After meeting him, he tweeted: "Met #namo. You know a leader has the youth pulse when he can discuss job creation and is still up for a selfie!"
Sharing his excitement upon getting a birthday wish from Mr Modi, Mr Bhagat posted: "When the front-running PM candidate of the world's biggest democracy remembers your birthday and posts a selfie, have to say, it feels nice."
The author is in any case on cloud nine ever since the movie version of his book "2 States" hit the silver screen on April 18. Starring Alia Bhatt and Arjun Kapoor, the film tells the love story of a Punjabi boy and a Tamilian girl.