Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LOS ANGELES — A federal judge on Friday told lawyers for President Donald Trump's attorney Michael Cohen that Cohen needs to file a declaration in court in order to delay a lawsuit filed by porn actress Stormy Daniels aimed at dissolving a confidentiality agreement that prevents her from talking about an alleged affair with Trump.

Judge S. James Otero said Cohen needs to file a statement declaring that his Fifth Amendment right against self-incrimination might be jeopardized if the case filed in Los Angeles goes forward.

Otero said at a hearing in Los Angeles that it was not enough for Cohen's attorney to file that statement on his behalf, and he gave Cohen until next Wednesday to do so.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Cohen sought to delay the civil case after FBI agents raided his office and residence, seeking records about the $130,000 agreement that Daniels signed days before the 2016 presidential election.

After the raids, Cohen asked the judge to grant a stay for at least 90 days and argued that because the allegations in the lawsuit overlap with the criminal investigation, Cohen's civil rights "may be adversely affected if this case proceeds."

Daniels' attorney, Michael Avenatti, objected to the requested delay and said he was pleased with the outcome of the hearing.

Avenatti said outside court it was "clear to me Michael Cohen and the president do not want to publicly state" that Cohen intends to invoke the Fifth Amendment.

Daniels, whose real name is Stephanie Clifford, has offered to return the $130,000 so she can "set the record straight." She argues the agreement is legally invalid because it was only signed by her and Cohen, not by Trump.

Cohen, who has denied there was ever an affair, said he paid the money out of his pocket using a home equity loan. He has said neither the Trump Organization nor the Trump campaign was a party to the transaction with Daniels and he was not reimbursed for the payment.

Trump answered questions about Daniels for the first time earlier this month and said he had no knowledge of the payment made by Cohen and didn't know where Cohen had gotten the money. The White House has repeatedly said Trump denies the affair.

Cohen's attorneys have accused Daniels of violating the confidentiality clauses more than 20 times and said she could be liable for $1 million in damages for each violation.

The case took on new significance last week when FBI agents raided Cohen's office, hotel and residence.

The agents were seeking any information on payments made to Daniels and a former Playboy model, Karen McDougal, according to people familiar with the investigation but not authorized to discuss it publicly. The search warrants also sought bank records, records on Cohen's dealings in the taxi industry and his communications with the Trump campaign, the people said.