A Vermont man on trial for driving the wrong-way on an interstate and crashing into an oncoming vehicle, killing five teenagers, was legally insane at the time, a psychiatrist for the defense testified on Tuesday.

Dr. David Rosmarin continued his testimony in the trial of Steven Bourgoin, 38, who has pleaded not guilty to five counts of second-degree murder and other charges in the October 2016 crash on Interstate 89 in Williston.

Bourgoin's attorneys acknowledge he caused the crash, but say he was insane at the time. In the days leading up to the crash, he believed he was in danger and thought he was getting inferences from lights, radios, television static, about what to do, said Dr. David Rosmarin.

"He did not intend to go the wrong direction and kill people or kill himself," said Rosmarin, who diagnosed him as having bipolar disorder with psychotic features. "He had been doing the same thing he had been doing for two days, which was driving around frantically trying to preserve his life, trying to understand what he had to do next to be safe."

Prosecutors allege that Bourgoin left his home that night, got onto the interstate going south and then turned around, heading north at speeds approaching 90 miles per hour (145 kph) in the southbound lane and colliding with the car that carried the five teenagers.

The crash killed Mary Harris, 16, of Moretown; Cyrus Zschau, 16, of Moretown; Liam Hale, 16, of Fayston; Janie Cozzi, 15, of Fayston; and Eli Brookens, 16, of Waterbury. Four of the teenagers attended Harwood Union High School in Duxbury. Cozzi attended Kimball Union Academy in Meriden, New Hampshire.

After the crash, Bourgoin allegedly stole a Williston police cruiser and headed south on the interstate before turning around and crashing again. He was injured and arraigned at the hospital.

Chittenden County State's Attorney Sarah George asked Rosmarin if the patterns, lights, or messages ever told Bourgoin to get on the interstate and turn around and drive the wrong way. Bourgoin never claimed to get a direct order but said in the days leading up to the crash he was getting direction from the inferences, Rosmarin said. George also pointed out that Bourgoin had told Rosmarin that he recalls driving into oncoming traffic and thinking he should turn around. The defense said that was referring to the second crash.

After the first crash, Bourgoin opened the door of the other vehicle and viewed "what he thought were mannequins burning," said Rosmarin, who said Bourgoin was confused about what happened. The prosecution, however, said Bourgoin tried to get up and run away from police after the second collision and said in other interviews that he remembered the crash as well as before and after it.

This was the first time that Bourgoin had been diagnosed with bi-polar disorder, George said, noting that other mental experts did not have the same finding.