"Narendramodi has India talking about toilets-and that's a great thing," Gates said in a tweet, which was re-tweeted by the Prime Minister.
Gates, along with his wife Melinda, had met Modi on September 19 during their visit to India.
Gates, who is involved in healthcare sector, had praised Modi's emphasis on community sanitation initiatives, and in particular, applauded his focus on providing toilets as a critical driver of child health, and a prominent factor in the safety and dignity of women and girls.