Modi pulled out a smartphone during his visit to the Temple of Heaven here as he posed for the shot with Chinese Premier Li.
"It's selfie time! Thanks Premier Li," Modi tweeted along with the photograph in which both leaders sported wide smiles.
Modi's selfie, an integral part of his overseas trips, was immediately liked on Facebook by its founder Mark Zuckerberg.
Modi also took a number of selfies with students and children at the joint Yoga and Taichi event at the Temple of Heaven.
The Prime Minister sportingly took selfies with smartphones of children as they jostled for getting clicked with Modi.
"Enjoyed interacting with China's youth," Modi tweeted later.
Modi is known for taking selfies on foreign tours with leaders, supporters and children.
Last year, during his trip to Australia, Modi posted a selfie with his "friend" and Australian counterpart Tony Abbott.
