The BBC said in a statement Thursday that it had agreed to pay damages to Ukraine President Petro Poroshenko.

It all stemmed from a since-retracted report, published in May 2018, that alleged Poroshenko had paid attorney Michael Cohen $400,000 to secure access to President Donald Trump.

The BBC issued a statement announcing the damages and said it accepts its report was untrue.

Poroshenko's lawyers had said the report caused their client "substantial distress and embarrassment.”

The BBC said, "We apologise to Mr Poroshenko for any distress caused."

The BBC said it would to pay damages to Ukraine President Petro Poroshenko to make amends for erroneously claiming in a report that he paid $400,000 to President Donald Trump's former personal attorney, Michael Cohen, to secure access to the US president.

In a statement posted on its website, the BBC said the report featured in an online article published in May 2018 and in its 10 p.m. news broadcast in the UK.

The BBC admitted in the statement that it "incorrectly reported" that Petro Poroshenko "had procured or authorised a corrupt payment of $400,000 to be made to Michael Cohen."

It reported that the payment was "to extend a brief meeting between Mr Poroshenko and President Trump, that had already been agreed, into more substantial talks."

According to the now retracted report, Poroshenko had been able to secure only a handshake and few moments of small talk with Trump after his election, and wanted more time with him.

Cohen testifies to the House Oversight and Reform Committee on February 27, 2019. AP Photo/J. Scott Applewhite

Business Insider reported on the BBC's claim at the time.

Trump hosted Poroshenko at the White House for extended discussions in June 2018.

In September, Britain's Daily Telegraph newspaper reported that Poroshenko’s lawyers had filed a libel action against the BBC over the story.

The lawyers said Poroshenko had been "seriously injured in his reputation and has been caused substantial distress and embarrassment." They said the false claim was particularly damaging because of Poroshenko’s role in promoting anti-corruption measures in Ukraine.

The claim asserted that the BBC had "no evidence of any payment or secret talks" and that it "chose to publish this hugely serious and damaging allegation despite its journalists having been repeatedly told by those alleged to be involved that it was completely untrue, and that there had been no payment and no back-channel talks."

In its statement, the BBC said it accepted allegation of the payment "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," it said.

Poroshenko, who has been Ukraine's president since 2014, is up for reelection in a national vote this weekend.

Cohen's relationship with Trump has collapsed since last May, with the former attorney sentenced to three years in prison in December for campaign-finance violations and lying to Congress, and denouncing his former boss as a "liar" and "racist" in recent testimony to Congress.