The BBC has agreed to pay substantial libel damages to Ukraine’s president, Petro Poroshenko, after wrongly claiming he had been involved in making a secret $400,000 payment to Donald Trump’s lawyer in return for access to the US president.

The original story said intermediaries acting on behalf of the Ukrainian president had paid Michael Cohen, then Trump’s lawyer, to ensure that Poroshenko received a lengthy meeting – and not just a photo opportunity – during a visit to the White House in June 2017.

The BBC claimed that a representative of Poroshenko made contact with Cohen, who has since turned on Trump, through a Jewish charity in New York and paid him to maximise his time with the president. Cohen, who always denied the claims, was not registered as a representative of Ukraine as by US law he would have been required to lobby on the country’s behalf.

Poroshenko, who is facing re-election this weekend and could lose to a comedian known for portraying a Ukrainian president in a popular TV show, sued in the English courts, saying the accusation was defamatory.

The BBC attempted to claim that its journalism made a less serious allegation than that claimed by Poroshenko’s lawyers.

However, after a judge at the high court in London sided with the Ukrainian president’s interpretation of the article, the BBC decided it could no longer defend its reporting. As a result the broadcaster agreed to pay damages and issue a correction; it must also pay the Ukrainian’s legal costs.

Poroshenko’s lawyer said he would receive a “substantial sum by way of compensation”.

A BBC spokesperson said: “In our News at Ten bulletin and in an online article published on 23 May 2018 we incorrectly reported that Petro Poroshenko, the president of the Ukraine, had procured or authorised a corrupt payment of $400,000 [about £306,000] to be made to Michael Cohen, the personal lawyer of Donald Trump, to extend a brief meeting between Mr Poroshenko and President Trump, that had already been agreed, into wider talks.

“We believed that the publications made a less serious allegation against Mr Poroshenko, but in the light of a finding by the high court that the allegation was as set out above, we are happy to accept that this allegation was untrue. We apologise to Mr Poroshenko for any distress caused and have agreed to pay him damages, legal costs and have participated in a joint statement in open court.”

The original story, by the BBC world affairs correspondent Paul Wood, was attributed to “sources in Kiev close to those involved” and a “high-ranking Ukrainian intelligence officer”. It was also backed up by the prominent anti-Trump lawyer Michael Avenatti, who represented Stormy Daniels and was recently charged with extortion on unrelated matters.

The BBC article, which has been deleted, also drew links between the meeting with the US president and Ukraine’s decision to drop an investigation into Trump’s former campaign manager Paul Manafort over his work for pro-Russian politicians. Manafort recently began a four-year jail term.

Poroshenko’s lawyer, Graham Atkins, said: “Mr Poroshenko did not authorise or procure any payment to Mr Cohen of any kind, nor was any such payment ever made to Mr Cohen or any other individuals for that purpose. Mr Poroshenko did not instruct close associates to open up any back channel with Mr Trump in order to secure substantial talks with him, far less did he do so through Mr Cohen.”

Atkins told the court that the damage has been exacerbated by the BBC leaving the article online for so long. “He believes that the resulting delay will inevitably have increased the damage caused to his reputation by the publication of this allegation.” he said.