Modi and Jinping had a conversation on a range of issues, MEA spokesperson Gopal Baglay said.
Modi arrived in the German city of Hamburg on Saturday to attend the G20 Summit after wrapping up his historic three-day visit to Israel.
The talks and handshake between the two leaders amid heightened tensions across borders in Dokalam area are of much significance.
In the meeting of the leaders of the BRICS nations Modi called for strengthening the fight against terrorism and climate change and for BRICS to play its role in the global economic recovery.
On Thursday, China had declared that the atmosphere was not "right" for a bilateral meeting between Modi and Jinping this week.
It also made the withdrawal of troops in the Sikkim section "the pre-condition" for "meaningful talks" and raised the possibility of "serious consequences" if the situation was allowed to fester.
India responded by insisting that no formal meeting was scheduled between Modi and Xi in Hamburg on the margins of the G20 Summit on July 7-8.
The tit-for-tat comments had signaled a deepening of the diplomatic standoff over the border tensions between India and China that have left their soldiers eyeball to eyeball for almost three weeks now.