President Donald Trump has insulted the physical appearance of Stormy Daniels, calling her “Horseface” in a tweet about a recent legal ruling, provoking an equally scathing reply from the porn actress.

Daniels called the president “Tiny” in her reply and also, in an apparent reference to the Horseface taunt, made a quip about bestiality.

A federal judge has dismissed Ms Daniels’ defamation lawsuit against Mr Trump.

Daniels alleges she had an affair with Mr Trump in 2006 and sued him in April.

The defamation lawsuit came after Mr Trump tweeted about a composite sketch of a man Daniels says threatened her in 2011 to keep quiet about an alleged affair.

He called it a “total con job”.

The judge on Monday said Mr Trump’s tweet was a “hyperbolic statement” protected under the First Amendment.

Mr Trump tweeted: “Great, now I can go after Horseface and her 3rd rate lawyer.”

Daniels’ attorney Michael Avenatti called Mr Trump’s comments “outrageous”.