BILLINGS, Mont. (AP) - A Wyoming teenager charged with slaying a couple and wounding their daughter after the family stopped to help him on Montana’s Crow Indian Reservation will rely on an insanity defense if the case goes to trial.

U.S. District Judge Susan Watters on Thursday ordered a mental examination for Jesus Deniz Mendoza at the request of his attorneys. Mendoza is charged with double murder, attempted murder and other charges in the July shootings of Jason and Tana Shane.

The exam would determine Mendoza’s mental condition at the time of the killings and if he is fit to stand trial.

Watters ordered that the findings be sealed from the public. Federal officials must conduct the exam over a maximum period of 45 days.

If a trial happens, under federal law Mendoza could be found guilty, not guilty or “not guilty only by reason of insanity.”

A not guilty by reason of insanity verdict would require Mendoza’s automatic commitment to a mental institution. He would remain in custody until he could prove that he does not pose a risk to injure someone or cause serious property damage.

Mendoza, of Worland, turned 19 last month. He suffers from an unspecified “severe mental disease or defect” that may have left him unable to appreciate the nature of his actions, Federal Defender David Merchant said in a Wednesday court filing.

Mendoza has pleaded not guilty to 12 criminal charges, including two counts of first degree murder. Friday is the deadline for him to seek a change in plea prior to trial scheduled for June 13.

Federal prosecutors had asked in February for Mendoza to undergo a mental exam to see if he was fit for trial.

But defense attorneys at the time opposed the move, arguing there were no signs Mendoza was unable to understand the charges against him or to assist in his own defense. Those are two primary standards for determining a criminal defendant’s competency.

“Simply stated, (my) lay opinion of Jesus has changed,” Merchant wrote in his notice that Mendoza would rely on an insanity defense.

Authorities say the Shanes and their 26-year-old daughter were shot with a .22 caliber rifle after stopping to help Mendoza along a roadside near Pryor. Mendoza told investigators he was tired of waiting around and shot the family in part because the Shanes’ daughter laughed at him, FBI agents have said in court filings.

Should Judge Watters determine that Mendoza is unfit for trial, he would be further evaluated to see if he can be rendered competent through drugs or other means.

“If yes, he gets treatment and then can stand trial,” said Assistant U.S. Attorney Melissa Hornbein.

If not, Mendoza likely would be civilly committed at the direction of the Bureau of Prisons, Hornbein said.

U.S. Attorney General Loretta Lynch in April decided against seeking the death sentence in the case if Mendoza were found guilty.

Mendoza faces a separate accusation of attempted second-degree murder in Washakie County, Wyoming, where authorities say he shot a man at a campground near the small town of Ten Sleep during a 2013 robbery attempt.