Michael Avenatti, lawyer to porn star Stormy Daniels, announced that an appeal was filed Monday within hours of a California federal judge dismissing his client's defamation lawsuit against President Trump.

"Here is the Notice of Appeal we just filed with the Ninth Circuit relating to the defamation claim against Trump. His record before the Ninth Circuit has been anything but good," Avenatti tweeted Monday evening, along with his signature "Basta" hashtag.

[Also read: Stormy Daniels forgives Michael Cohen, says he 'looked like he had a weight off his shoulders' in chance encounter]

The 9th Circuit Court of Appeals is known to lean liberal and has been a thorn in Trump's side on issues including immigration.

Daniels, who claims she had an extramarital affair with Trump more than a decade ago, sued after Trump tweeted in April that a forensic sketch of a man who allegedly threatened Daniels — whose real name is Stephanie Clifford — over the alleged tryst in 2011 was a “total con job.”

Trump's legal team used a freedom-of-speech defense, and U.S. District Judge James Otero agreed, saying the "First Amendment protects this type of rhetorical statement."

The ruling also stated Daniels must pay Trump's legal fees.

"Be clear - even assuming Trump is owed attys fees from the defamation case (if he wins the appeal), they will be dwarfed by the fees he and Cohen will be required to pay in connection with the NDA case. Not even close. Yet more 'winning' from Trump," Avenatti said in response.

Trump has denied the affair with Daniels. His former personal lawyer Michael Cohen, who pleaded guilty to eight counts in August, paid her $130,000 in exchange for her silence on the affair, but she filed a lawsuit earlier this year claiming the nondisclosure agreement she signed should be nullified because Trump didn’t sign it.