A United States judge has ignored the government’s wishes by ruling President Donald Trump and porn star Stormy Daniels can be mentioned in a court case involving a prominent California lawyer.

The New York trial of Michael Avenatti will begin next Monday, with the 48-year-old charged with trying to extort between $15 million and $25 million (£11.49 million – £19.15 million) from apparel giant Nike.

The case is likely to involve evidence setting out how Avenatti has become well known as a lawyer.

Avenatti rose to fame representing Ms Daniels in her battle to be released from a non-disclosure deal she had signed regarding an alleged affair with Mr Trump.

Michael Avenatti Charges
Michael Avenatti, who faces charges of trying to extort money from Nike (Seth Wenig/AP)

Avenatti made scores of appearances on TV shows criticising the president, who has denied the affair occurred.

On Wednesday, prosecuting lawyer Daniel Richenthal asked US District Judge Paul G. Gardephe to ban mention of Mr Trump and Ms Daniels in Avenatti’s extortion hearing, insisting it would politicise the trial if jurors heard their names.

The judge said nothing would make him happier than to keep their names out of the trial.

“But I can’t pretend there was sort of an immaculate conception here where Mr Avenatti suddenly became this incredibly public lawyer magically,” he said.

Judge Gardephe said he had tried to think of a lawyer with more notoriety than Avenatti but could not.

“We’re deeply troubled,” Mr Richenthal said. “This case has nothing to do with politics in any way, shape or form.”

Avenatti has repeatedly spoken out against the Trump administration and the Justice Department, saying he was targeted for criticising the president.

Besides the Nike case, he also faces trial in April on charges of cheating Daniels out of book deal proceeds, and another trial in May on charges he cheated others out of money, including clients.

Avenatti has pleaded not guilty to all charges.

A week ago, he was arrested in Los Angeles on allegations he violated the conditions of his bail by moving money illegally after his initial arrest last spring.

On Wednesday, he sat in court in his prison blue uniform and orange slippers, as he studied documents and passed notes to his lawyers.

His trial, in New York, is expected to last up to three weeks.