PLYMOUTH (CBS) — A Maine man charged in drive-by shootings that left two people hurt early Sunday morning in Duxbury was ordered to undergo a mental evaluation at Bridgewater State Hospital.

Lucas McPherson, 25, of Mapleton was arraigned Monday in Plymouth District Court Monday to answer to three counts of assault and battery and three counts of attempted murder.

A judge ordered McPherson to be held for 20 days at the hospital, where he will be evaluated for competency after a court psychiatrist, Dr. Daniel Richard testified that McPherson was uncooperative and his father said he was schizophrenic and off his medication.

He allegedly shot at the first victim, a 33-year-old Marshfield man, in the stomach while he was driving past McPherson on Tremont Street around 1:15 a.m.

The second shooting happened about 20 minutes later in the Tobey Garden Street area, police say, as a Duxbury man standing on his front porch was shot while letting his dog outside.

“His face was covered in blood and he was yelling ‘What happened? What happened? I think I got shot,'” said prosecutor Kathleen Kramer.

The victims were rushed to South Shore Hospital in Weymouth after suffering non-life-threatening injuries.

Investigators say Duxbury Police Officer Dennis Pearce was able to block McPherson’s Chevy Impala, and when he attempted to take McPherson into custody he lunged at the officer with a knife. That’s when Pearce used a stun gun twice to subdue him.

Prosecutors say Pearce showed remarkable restraint by not using his gun during the incident. He suffered minor injuries in a struggle with McPherson.

“It was a very spontaneous event, and for the police officer to do the job he did, I think it’s tremendous,” said Plymouth County District Attorney Timothy Cruz.

A double-barreled shotgun believed to have been used in the shootings was found inside McPherson’s car.

The shootings have been deemed random by police, as McPherson had no apparent connection to the victims.

WBZ-TV’s Bill Shields and WBZ NewsRadio 1030’s Karen Twomey contributed to this report.

WBZ NewsRadio 1030’s Karen Twomey reports

Comments