MODESTO, Calif. — A Mexican man in the U.S. illegally charged in the killing of a California police officer returned to court Thursday for the judge to hear the results of a mental health evaluation.

Gustavo Perez Arriaga, also known as Paulo Mendoza, was charged in the Dec. 26 shooting death of Cpl. Ronil Singh of the tiny Newman Police Department during a traffic stop.

In a hearing last month, Arriaga's attorney questioned his client's mental competency, leading the court to delay the case until a mental health evaluation was completed.

However, on Thursday in court, that same defense attorney said he withdrew his doubts and called the doctor's review a "violation of his client's rights" and challenged the release of that report.

A judge granted a temporary seal, which means only the attorneys can see what's in the report and Mendoza's arraignment was continued for April 8. The judge also ordered Foley to hand a copy over to Deputy District Attorney Jeff Mangar.

RELATED: Accessory defendants in Newman Cpl.’s death to face federal prosecution, County keeps murder case

RELATED: Slain Cpl. Singh's brother backs the border wall with President Trump

It is still unclear what was in the mental health report and if Mendoza is considered competent to stand trial.

Arriaga is going through a capital case right now for being accused of killing Cpl. Singh, which means if he's found competent to stand trial, in the state of California, he is eligible for the death penalty.

"The issue is whether or not the criminal defendant is competent at the time the case begins and proceeds, competency can be questioned at any point during the pendency of the trial," Blake Wilson, a criminal justice professor at Stanislaus State said.

Wilson, a former criminal defense attorney, told ABC10 that it was Foley's duty and likely not strategy to report this kind of doubt.

"Council may have had that doubt in the beginning of January and may no longer have that doubt for a variety of different reasons and it's certainly appropriate for defense council to notify the court that they no longer have that doubt," he said.

After the court appearance, the Stanislaus County District Attorney's Office told ABC10 they won't be doing any interviews because, "It's too important to risk a change of venue from excessive publicity."

ABC10 asked Wilson if that's a possibility.

"My instinct right now, is if you were to do an informal poll of adults who pay attention to the news, most people would know about the immigration status of this case," he said.

He says a "change of venue" meaning moving the trial out of town, could be granted if a judge is convinced Mendoza won't receive a fair trial based on some of these factors. 

"Those factors are going to focus on what you might call the popularity of the victim, it might take into consideration the unpopularity or status or demographics of the defendant and quite literally the amount of publicity," he said

So what's next?

If Arriaga is found competent, the case will proceed. He'll be arraigned and make an official plea. 

"And it could proceed down two tracks, one is the track to trial, two is the track to guilty plea," Blake Wilson, a criminal justice professor at Stanislaus State said. "It is highly unusual for a defendant to plead guilty in capital cases because they would either be pleaded guilty to life without parole or condemnation."   

Arriaga is expected to appear back in court on April 8 at 8:30 a.m.

Authorities say Arriaga was in the country illegally and was fleeing back to his native Mexico when he was arrested two days after Singh's killing.

The case rekindled a debate over California's sanctuary law that limits cooperation by local authorities with federal immigration authorities.

________________________________________________________________

WATCH MORE: Memorial service for slain Newman Police Cpl. Ronil Singh

The memorial service for slain Newman Police Cpl. Ronil Singh is at 10 a.m. on Jan. 5, followed by a funeral procession at 11:30 a.m. Cpl. Singh was shot and killed during a traffic stop on Dec. 26, 2018.