LONDON — The U.K. Prime Minister, David Cameron, has had his knuckles rapped by a judge for expressing support for TV chef Nigella Lawson, who is the main prosecution witness in a fraud trial.

Lawson, who appears on ABC’s cooking show “The Taste,” is the key witness in the trial of her former assistants, Francesca and Elisabetta Grillo. They are accused of spending, without authorization, £685,000 ($1.12 million) on credit cards belonging to the company of Lawson and her former husband.

In an interview with The Spectator magazine, Cameron was asked, “Are you on team Nigella?” To which he replied, “I am.”

Cameron added: “I’m a massive fan. I’ve had the great pleasure of meeting her a couple of times, and she always strikes me as a very funny and warm person, but I’m also an amateur cook and I like her recipes. Nancy (Cameron’s daughter) and I sometimes watch a bit of Nigella on telly. Not in court, I hasten to add.”

The judge in the trial, Robin Johnson, said Cameron had made comments that were “favorable to Lawson,” and told the jury to ignore them.

Johnson warned the jurors to decide the case only on the evidence presented in court.

He said: “It is inconceivable that some of your number have not seen the reports. The defendants feel aggrieved as the comments, although they do not specifically deal with matters in this trial, are favorable to Miss Lawson.

“The fact they feel aggrieved is not without justification. You will realize that what public figures say or feel about a witness in this case has no bearing on matters that you decide.”