Years after a video recording captured Donald J. Trump bragging about grabbing women by their genitals, he said in a deposition for a trial accusing him of rape that he was merely stating a historical truth.

The “Access Hollywood” tape, made public in 2016 — and replayed for a Manhattan jury on Thursday — at first looked as though it might derail his presidential campaign. It did not, and it later became a symbol of his invulnerability to scandal. Asked about the episode by a lawyer for the writer E. Jean Carroll, who has accused him of raping her in a Bergdorf Goodman dressing room in the mid-1990s, Mr. Trump did not repudiate what he had said.

“Well, historically, that’s true with stars,” Mr. Trump says in a video of the deposition.

“True with stars that they can grab women by the pussy?” Ms. Carroll’s lawyer, Roberta A. Kaplan, asks.

“Well, that’s what — if you look over the last million years, I guess that’s been largely true,” Mr. Trump says. “Not always, but largely true. Unfortunately or fortunately.”

On Thursday, as the trial concluded its second week, Ms. Carroll’s lawyers rested their case.

The defendant has been absent throughout, but he still loomed over the proceeding in federal court. He has been cited in testimony, photographs and legal arguments. And over two days this week, he appeared in a different form, as Ms. Carroll’s lawyers played for the jury excerpts from a video deposition they had taken of Mr. Trump in October.

In the video clips, he sits at a table, dark-suited and solemn, answering questions posed by Ms. Kaplan. He calls Ms. Carroll “a wack job,” “sick” and “a nut job” and turns his disdain on Ms. Kaplan, calling her a “political operative” and a “disgrace” and insulting her to her face.

At one point, he is asked whether he ever contacted Bergdorf Goodman after Ms. Carroll’s allegation to gather evidence that would disprove her.

“I didn’t have to reach out to anybody, because it didn’t happen,” Mr. Trump says. “It’s the most ridiculous, disgusting story. It was just made up.”

At one point, Ms. Kaplan asks about a statement Mr. Trump made in June 2019, after Ms. Carroll first told her story in a magazine. At the time, Mr. Trump denied that the encounter had even occurred and added that he could not have raped Ms. Carroll because she was not his “type.”

Ms. Kaplan, in an excerpt the jury was shown on Thursday, asks him to explain that statement.

“You wouldn’t be a choice of mine, either, to be honest,” Mr. Trump tells her. “I wouldn’t under any circumstances have any interest in you.”

Late on Thursday, after Ms. Carroll’s lawyers ended their case, Mr. Trump’s lawyer, Joseph Tacopina, rested his case as well — sort of.

The former president, who has been traveling abroad, said Thursday morning while playing golf in Ireland that he might return to New York to attend the Carroll trial. “I have to go back for a woman that made a false accusation about me, and I have a judge who is extremely hostile,” Mr. Trump said, according to Reuters.

But in court Thursday afternoon, Mr. Tacopina made it clear to the judge, Lewis A. Kaplan, that Mr. Trump would not testify, which he said he had confirmed with his client before arriving at court that morning.

Judge Kaplan, noting that he was aware of news reports of Mr. Trump’s comments from Ireland, said that he would allow Mr. Tacopina to file a motion as late as 5 p.m. Sunday asking the judge to allow Mr. Trump to testify on his own behalf.

“If he has second thoughts, I will at least consider it,” Judge Kaplan said.

Closing arguments for both sides are scheduled for Monday, and the jury could receive the case Tuesday.

Ms. Carroll has testified that she told two friends about the attack almost immediately afterward. One, Lisa Birnbach, testified earlier this week. On Thursday, the jury heard from the other, Carol Martin.

Ms. Martin, a retired news anchor and a former co-worker of Ms. Carroll’s at a cable channel, testified that Ms. Carroll had asked one day if they could talk after work. They drove to Ms. Martin’s home and sat in her kitchen.

“‘You won’t believe what happened to me the other night,’” Ms. Martin recalled Ms. Carroll’s telling her. “‘Trump attacked me.’”

“I was completely floored,” Ms. Martin said.

Ms. Martin said that Ms. Carroll had never used the word rape and that she instead said she had been fighting with Mr. Trump.

“It was a very disconcerting thing to hear,” Ms. Martin said. She said she had advised Ms. Carroll not to tell anyone or to go to the police because Mr. Trump had a lot of lawyers who would “bury her.”

“I am not proud that that’s what I told her,” Ms. Martin testified.