For more on this story:

Cohen acknowledged in court that the aim was indeed to protect Mr Trump's candidacy, saying he had paid the money "at the direction" of Mr Trump "for the principal purpose of influencing the election".

If Mr Trump were to be prosecuted over the money - not through the normal courts, because he is the sitting president, but conceivably in Congress, through an impeachment process - investigators would have to prove that he had indeed given the money to Cohen for electoral reasons.

How has Trump contradicted himself?

In his first public comments, back in April, about his alleged affair with Stormy Daniels, Mr Trump denied knowing about the $130,000 (£100,000) payment made to the actress via Cohen.

Ms Daniels, whose real name is Stephanie Clifford, alleges that she and Mr Trump had sex in a hotel room in 2006.

Asked by a reporter in the press cabin of Air Force One if he had any knowledge about where Cohen had got the money to pay Ms Daniels, the president responded at the time: "I don't know."

The following month, Mr Trump officially disclosed a payment to Cohen of between $100,001 and $250,000 for expenses incurred in 2016.

What happens next?

Any action against Mr Trump is unlikely until after the mid-term elections on 6 November, when the opposition Democrats will seek to break the grip of Mr Trump's Republican Party on Congress.

In the meantime, Cohen may agree to testify to the inquiry into alleged collusion between the Trump campaign and Russia.