The gathering in Bali was dominated by the war and its impact on food security and energy, a topic discussed in almost all bilateral meetings, Indonesian Foreign Minister Retno Marsudi said.
It was not immediately clear from Retno's briefing whether any agreements had been reached during Friday's meeting.
At the start of the day's events, shouts of "When will you stop the war" and "Why don't you stop the war" were heard as Russian Foreign Minister Sergei Lavrov shook hands with Retno upon his arrival.
Lavrov said ministers from Western nations "strayed almost immediately, as soon as they took the floor, to the frenzied criticism of the Russian Federation in connection with the situation in Ukraine".
"'Aggressors', 'invaders', 'occupiers' - we heard a lot of things today," Lavrov told reporters after the first session of the talks, where he was seated between representatives from Mexico and Saudi Arabia.
Russia calls the war a "special military operation" to degrade the Ukrainian military and root out people it calls dangerous nationalists.
Ukraine and its Western backers say Russia is engaged in an imperial-style land grab with no justification for its invasion.
Retno opened the meeting calling on the G20 to "find a way forward" to address global challenges and said the repercussions of the war, including rising energy and food prices, would hit low-income countries the hardest.
"It is our responsibility to end the war sooner rather than later and settle our differences at the negotiating table, not at the battlefield," Retno said at the opening of talks.
Challenges related to rising food and energy costs had been "dramatically exacerbated by Russian aggression against Ukraine", US Secretary of State Antony Blinken said on the sidelines of the meeting.
During the plenary, Blinken confronted Russia about blocking the export of Ukrainian grain and stealing it, a Western official said.
"He addressed Russia directly, saying: To our Russian colleagues: Ukraine is not your country. Its grain is not your grain. Why are you blocking the ports? You should let the grain out'", the official said.
Lavrov was not in the room at the time, the official said.
Lavrov and Blinken did discuss things while in the meeting room, Retno said, without elaborating.
Ukraine, the world's fourth-largest grain exporter, has struggled to export goods, with many of its ports blocked as war rages along its southern coast.
Lavrov told reporters later that Russia was ready to negotiate with Ukraine and Turkey about grain, but it is unclear when such talks might take place.
Meetings were overshadowed by the assassination of former Japanese Prime Minister Shinzo Abe, which Blinken described as "profoundly disturbing".
Ukraine's foreign minister addressed the meeting virtually, accusing Russia of playing "hunger games" through its blockade of Ukraine's Black Sea port.
Lavrov left the room during his speech, Ukraine's ambassador to Indonesia said.
Chinese Foreign Minister Wang Yi said earlier that Beijing opposed any act of hyping up bloc confrontation, and creating a "new Cold War".