The Ukrainian and Polish presidents marked the anniversary of massacres of Poles by Ukrainian nationalists during World War Two on Sunday, killings that have been a source of tension between the allies.
Warsaw has positioned itself as one of Kyiv's staunchest supporters since Russia invaded the country in 2022.
However, the Volhynia massacre, in which historians say tens of thousands of Poles perished, has continued to hang over ties between the two nations and become more prominent ahead of the July 11 anniversary of one of the bloodiest days of a series of killings that took place from 1943 to 1945.
Television footage showed Ukraine's Volodymyr Zelensky and his Polish counterpart Andrzej Duda in a church in the western Ukrainian city of Lutsk on Sunday during a service held in memory of the victims.
Polish historians say that up to 12,000 Ukrainians were also killed in Polish retaliatory operations.
"Together we pay tribute to all the innocent victims of Volhynia! Memory unites us!," Duda's office wrote on Twitter. "Together we are stronger."
Zelensky tweeted the same statement in both Ukrainian and Polish.
Historical trauma for both Poland and Ukraine
The massacre caused an unusually public row between Poland and Ukraine earlier this year, after a Polish foreign ministry spokesman said that Zelensky should apologize and ask for forgiveness for the events in Volhynia.
However, Ukraine's parliament speaker Ruslan Stefanchuk moved to defuse tensions in May when he told the Polish parliament that Kyiv understood Poland's pain.
On Friday Polish Prime Minister Mateusz Morawiecki visited western Ukraine to pay tribute to the victims.
The Polish parliament has said that the murders, carried out between 1943 and 1945 by the Ukrainian Insurgent Army and the Organization of Ukrainian Nationalists under the leadership of Stepan Bandera, bore elements of genocide.
Ukraine has not accepted that assertion and often refers to the Volhynia events as part of a conflict between Poland and Ukraine which affected both nations.