Boris Johnson has urged ministers to do "everything in their power" to secure the release of two Britons condemned to death for fighting Russian forces.
Aiden Aslin and Shaun Pinner were captured while with the Ukrainian army and tried as mercenaries by a Russian proxy court in eastern Ukraine.
Their families have called for them to have urgent legal and medical help.
Foreign Secretary Liz Truss spoke to her Ukrainian counterpart Dmytro Kuleba on Friday about the two captured men.
She said they discussed "efforts to secure the release of prisoners of war held by Russian proxies", adding that "the judgement against them is an egregious breach of the Geneva Convention".
Mr Aslin, 28, from Newark, in Nottinghamshire, and Mr Pinner, 48, from Bedfordshire, who were both already living in Ukraine at the time of the Russian invasion, were captured in April while defending the besieged city of Mariupol.
They were sentenced alongside a third man, Moroccan national Saaudun Brahim, by a Russian proxy court in the so-called Donetsk People's Republic, a pro-Russian breakaway region in eastern Ukraine.
All three men were charged with being mercenaries, the violent seizure of power and undergoing training to carry out terrorist activities, according to Russia state news agency RIA Novosti.
The Britons' families have insisted they are long-serving members of the Ukrainian military and not mercenaries.
Mr Brahim's father told Moroccan media outlet Madar21 that his son was not a mercenary but a student in Ukraine when Russia launched its invasion.
The men's lawyer said they all wished to appeal against the sentence, Russia's Tass news agency reported.
On Friday, a No 10 spokesman said the prime minister "was appalled at the sentencing of these men".
He said Mr Johnson "has been following the case closely and has asked ministers to do everything in their power to try and reunite them with their families as soon as we can".
"We completely condemn the sham sentencing of these men to death. There's no justification at all for this breach of the protection they're entitled to," the spokesman added.
Defence Secretary Ben Wallace travelled to Kyiv to meet President Volodymyr Zelensky and Ukraine's Defence Minister Oleksii Reznikov.
A statement from the Ministry of Defence said Mr Wallace discussed how the UK support will continue to meet Ukraine's needs as the conflict enters a different phase".
Speaking at a virtual Q&A to university students later, Mr Zelensky said that we "cannot have any kind of excuses for such actions".
Aiden Aslin and Sean Pinner may have been sentenced to death, but what happens now is likely to be determined more by politics than the law.
In the short term, it is thought likely the two men will appeal against the conviction. Russian state media says they have a month to do so.
But for now Foreign Secretary Liz Truss has not summoned Russia's ambassador in London.
Officials fear that if the UK makes this a bilateral dispute with Russia, that would fuel the false claims that the two men are mercenaries, rather than Britons who have made Ukraine their home and served in its armed forces for several years.
Nor could Ms Truss formally negotiate with the authorities in Donetsk because UK does not recognise the People's Republic as a separate state.
So for now perhaps the best hope might be for Mr Aslin and Mr Pinner to be released as part of a prisoner swap between Ukraine and Russia. But that might be some time coming if Russia wishes to continue using the two men to put political pressure on the UK.
Russian Foreign Minister Sergei Lavrov was quoted by RIA Novosti as saying the trials were "being held on the basis of the legislation of the Donetsk People's Republic, because the crimes in question were committed on the DPR's territory".
Baroness Helena Kennedy, a senior barrister and expert in human rights law, told the BBC "Russia committed a war crime by handing them both over to the DPR (Donetsk's People's Republic), which is not a legitimate state".
She called the court in Donetsk a "pop-up court", adding that the decision "is a comeback for the trial of the two men who were tried by the Ukrainian court for war crimes".
Robert Jenrick, MP for Newark, where Mr Aslin's family lives, said the sentencing of the British nationals by a "kangaroo court" breached the Geneva Conventions "in the most egregious manner".
Richard Fuller, MP for North Bedford, said he had spoken to Mr Pinner's mother and stepfather who "clearly are very, very anxious".
"This is a humanitarian issue. This is about the rights of individuals under international law," he said.
Who are Aiden Aslin and Shaun Pinner?
Aiden Aslin is a former care worker from Nottinghamshire. He previously fought with Kurdish armed units in Syria against the Islamic State group.
Mr Aslin has a Ukrainian fiancee and he moved to Ukraine in 2018. He has both British and Ukrainian citizenship.
He passed out as a marine with the Ukrainian military in 2018 and, according to his family, he is part of Ukraine's 36th Marine Brigade.
Shaun Pinner used to be a soldier in the British army before he moved to Ukraine in 2018.
His wife is Ukrainian and according to his family, Mr Pinner has a three-year contract with the Ukrainian marines that is due to expire at the end of this year.
Mr Pinner's family said he had been planning to then take on a humanitarian role in Ukraine.