Chip Somodevilla/Getty Images

A federal judge rejected a Justice Department motion to dismiss a defamation lawsuit brought against President Donald Trump by a woman who accused him of rape decades ago.

The federal judge concluded that the president's denials and statements about the case were outside of his official duties.

Writer E. Jean Carroll wrote a book in 2019 claiming Trump raped her during an encounter at a New York department store in the 1990s.

After the publication of Carroll's book, Trump told reporters she made the story up. Carroll then sued Trump for defamation.

The DOJ filed a motion to dismiss the federal lawsuit, saying Trump's denial of the allegation was part of his official duties as president.

The DOJ said Trump was protected because of immunity extended for libel and slander cases under the Federal Tort Claims Act (FTCA).

In a ruling on Tuesday, U.S. District Judge Lewis A. Kaplan rejected the DOJ's claim, writing that the president is not an employee of the government within the meaning of the FTCA, and that even if he were, his statements concerning Carroll were outside the scope of that employment.

Kaplan wrote that Trump's comments "concerned an alleged sexual assault that took place several decades before he took office, and the allegations have no relationship to the official business of the United States..."