A future Labour government would ensure the defence needs of Ukraine continued to be met, Sir Keir Starmer told the country's president Volodymyr Zelensky.
In face-to-face talks in Kyiv, the Labour Party leader assured Mr Zelensky that Ukraine would have his "unwavering support" against Russian aggression if he became Britain's next prime minister.
With Labour well in front of Prime Minister Rishi Sunak's Conservative Party in most national opinion polls, Sir Keir could be walking through the black door of 10 Downing Street as the UK's new leader after the next general election.
Sir Keir told Mr Zelensky, during their first conversation in Ukraine since Russian president Vladimir Putin's troops invaded, that a Labour administration would "maintain the defence, training, and technological support" that was currently being provided by the UK.
The Opposition leader's surprise visit to the Ukrainian capital comes a week before the first anniversary of the bloody conflict with Moscow.
It also comes after Mr Zelensky visited Britain and other European capitals last week to appeal for the West to give his air force fighter jets, as Ukraine prepares to counter an expected Russian spring offensive.
Labour said Sir Keir used his meeting with the war leader on Thursday to discuss both continued support for Ukraine but also the issue of justice.
In a statement issued by the party, Sir Keir said: "I had a very constructive meeting with President Zelensky, and we were able to discuss the support that Ukraine needs and the justice that it deserves.
"We spoke about the need for that justice to cover both the use of Russian state assets for reconstruction and the need for there to be prosecutions for war crimes.
"I was able to tell him that should there be a change of government when we have a general election here, the support for Ukraine will remain the same."
The statement continued: "It's a very important message for me to be able to relay to the president face-to-face, and I've been able to do that this afternoon.
"We discussed a range of issues, he's very concerned about support through weapons and the continuation of training for Ukraine, and I stressed that the Labour Party supports and would maintain the defence, training and technological support the current UK government is providing.
"I've said throughout this conflict there will be no difference between the political parties on this, so we will continue to work with the Government to see what further support we can provide."
During his visit to the war-torn country, Sir Keir spoke to reporters in Irpin, a Kyiv suburb where heavy fighting took place in the first months of the invasion.
He also travelled to Bucha, on the outskirts of the capital, an area where war crimes were allegedly carried out by the Kremlin's occupying armed forces.
Sir Keir, a former director of public prosecutions, used his time in eastern Europe to speak with experts in human rights, reconstruction and appropriations.
He told reporters: "It's incredible to see the evidence of atrocities that I've seen this morning.
"Photographs of civilians in the outskirts of Kyiv blindfolded, with their arms tied behind their back.
"There has to be justice for this. There has to be justice in The Hague and there has to be proper reparation in the rebuilding of Ukraine."