PHOTO: Photo Illustration: Getty/Shutterstock/CNNMoney
Now playing
03:10
Trump team's repeated lies on Stormy Daniels
Now playing
02:26
See Biden sign executive order lifting transgender military ban
WASHINGTON, DC - AUGUST 10:  The Trump International Hotel is shown on August 10, 2017 in Washington, DC.  The hotel, located blocks from the White House, has become both a tourist attraction in the nation
WASHINGTON, DC - AUGUST 10: The Trump International Hotel is shown on August 10, 2017 in Washington, DC. The hotel, located blocks from the White House, has become both a tourist attraction in the nation's capital and also a symbol of President Trump's intermingling of business and politics. (Photo by Win McNamee/Getty Images)
PHOTO: Win McNamee/Getty Images
Now playing
01:56
Why SCOTUS is dismissing emolument cases against Trump
PHOTO: CNN
Now playing
02:20
Legal analyst: Dominion's case looks pretty strong
Now playing
03:19
Some GOP lawmakers are defying Capitol security measures
PHOTO: CNN
Now playing
01:17
Sen. Romney: Senate trial after Trump leaving office is constitutional
PHOTO: CNN
Now playing
03:25
Biden's HHS secretary pick: If we do this, we will get the pandemic under control
Now playing
07:26
'What research did you do?': Brown presses GOP lawmaker on election fraud claims
PHOTO: CNN
Now playing
01:42
Acosta describes covering last day of Trump administration
WASHINGTON, DC - FEBRUARY 06: Rep. Alexandria Ocasio-Cortez (D-NY) attends a press conference with Rep. Andy Levin (D-MI) about their new bill called the EV Freedom Act on Capitol Hill on February 6, 2020 in Washington, DC. The EV Freedom Act is a plan to create a nation wide charging infrastructure for electric vehicles. (Photo by Samuel Corum/Getty Images)
WASHINGTON, DC - FEBRUARY 06: Rep. Alexandria Ocasio-Cortez (D-NY) attends a press conference with Rep. Andy Levin (D-MI) about their new bill called the EV Freedom Act on Capitol Hill on February 6, 2020 in Washington, DC. The EV Freedom Act is a plan to create a nation wide charging infrastructure for electric vehicles. (Photo by Samuel Corum/Getty Images)
PHOTO: Samuel Corum/Getty Images
Now playing
03:35
Rioter charged with threatening to 'assassinate' Ocasio-Cortez, officer
Now playing
02:41
Loyal Texas Trump voters want Biden to be less divisive
Now playing
01:16
Sen. Patrick Leahy doubles as a Batman actor
Now playing
01:33
Chuck Schumer announces timeline for Trump impeachment
WASHINGTON, DC - JANUARY 22: U.S. President Joe Biden signs an executive order as Vice President Kamala Harris looks on during an event on economic crisis in the State Dining Room of the White House January 22, 2021 in Washington, DC. President Biden spoke on his administration
WASHINGTON, DC - JANUARY 22: U.S. President Joe Biden signs an executive order as Vice President Kamala Harris looks on during an event on economic crisis in the State Dining Room of the White House January 22, 2021 in Washington, DC. President Biden spoke on his administration's response to the economic crisis that caused by the COVID-19 pandemic and signed two executive orders. (Photo by Alex Wong/Getty Images)
PHOTO: Alex Wong/Getty Images North America/Getty Images
Now playing
02:31
Biden zeroes in on the teetering economy in first week
White House senior adviser Kevin Hassett speaks with reporters at the White House, Friday, June 19, 2020, in Washington. (AP Photo/Alex Brandon)
White House senior adviser Kevin Hassett speaks with reporters at the White House, Friday, June 19, 2020, in Washington. (AP Photo/Alex Brandon)
PHOTO: Alex Brandon/AP
Now playing
05:08
Ex-Trump official who supports Biden stimulus plan speaks out
(CNN) —  

A lawsuit by adult film star Stormy Daniels against President Donald Trump over a non-disparagement agreement has been tossed out of federal court.

US District Judge James Otero says the suit, which sought to invalidate the $130,000 agreement that kept Daniels from speaking publicly about her allegations of an affair with Trump ahead of the 2016 election, should be sent back to California Superior Court. In his ruling, Otero says the suit “lacks subject matter jurisdiction.”

By remanding the case back to where it was first filed, Otero made it clear the case is over.

Daniels, whose real name is Stephanie Clifford, says she and Trump had an affair in 2006, after he married first lady Melania Trump and she gave birth to their son, Barron. Trump has denied having an affair with Daniels.

Trump’s former personal lawyer, Michael Cohen, arranged the nondisclosure agreement and paid Daniels $130,000. He admitted in federal court that “in coordination and at the direction of a candidate for federal office,” he kept information that would have harmed Trump from becoming public during the 2016 election cycle. He has since said that the candidate was Trump.

Cohen has since been sentenced to three years in prison after pleading guilty to nine charges, including campaign-finance violations related to payments he arranged to silence women who claimed affairs with Trump – including Daniels. Trump has denied having affairs with the women.

During the course of the case, Cohen and Trump agreed with Daniels saying the agreement would not be enforced. But, Daniels’ attorney Michael Avenatti said his client wanted the judge to rule that what Cohen and Trump did was illegal.

Instead, Daniels’ case was dismissed in favor of the defendants.

By dismissing the case, the judge essentially gave Daniels what she wanted all along – to be able to tell her story without the fear of being sued for millions of dollars, Avenatti said.

“The court found that Ms. Daniels received everything she asked for by way of the lawsuit – she won,” Avenatti told CNN.

Otero is the same judge who also dismissed Daniels’ separate defamation cases against Trump and Cohen. In addition to dismissing the defamation lawsuit, Otero ordered Daniels to pay nearly $300,000 in attorney’s fees.

Daniels sued the President after he said in a tweet posted in April that her tale of a man threatening her not to come forward with her story of her alleged affair with Trump was “a total con job.” Trump had asked Otero to dismiss the lawsuit.

Daniels told CBS’ “60 Minutes” in March 2018 that she was approached in a Las Vegas parking lot while she was with her daughter in 2011. She said a man walked up to her and said, “Leave Trump alone. Forget the story,” and looked at her infant daughter and said, “That’s a beautiful little girl. It’d be a shame if something happened to her mom.”

At the time, Daniels had agreed to tell her story to In Touch magazine for $15,000, but two sources told “60 Minutes” that the deal fell through because Cohen threatened to sue the publication. Daniels said she never got paid.

Trump’s attorney, Charles Harder, told CNN in a statement, “The US District Court confirmed today that the claim against the President has no basis in law. Combined with the attorneys’ fees and sanctions award in the President’s favor totaling $293,000, the President has achieved total victory.”

“Clifford’s attorney would claim victory if he got run over by a bus,” added Brent Blakely, Cohen’s attorney. “Clifford has lost every argument in these lawsuits since day one – her defamation cases have been dismissed and now the Court has granted EC’s motion regarding subject matter jurisdiction.”