Just weeks after a controversial trip to Moscow, Narendra Modi became the first Indian prime minister ever to visit Ukraine, pledging to help the war-torn country find a diplomatic solution to ending the 2½-year-old conflict with Russia.

The Indian leader reiterated the need for a peaceful resolution to the war “through dialogue and diplomacy” during talks Friday in Kyiv with Ukrainian President Volodymyr Zelenskyy that appeared to underscore a growing desire for New Delhi to play at least some kind of peacemaker role.

But while Zelenskyy and Modi greeted each other with a hug — a scene that played out similarly to when the Indian leader met Russian President Vladimir Putin last month — experts say the gathering mainly highlighted India’s delicate balancing act as it tries to navigate tricky relations with both the West, with which it seeks greater cooperation, and its long-standing partner, Russia.