A California man's alleged drug-induced rampage brought a violent end to the Fourth of July for eight people, authorities said.

Betai Koffi, 32, rammed a stolen truck into strangers and stabbed a friend with a pencil after taking LSD, also known as acid, said Sonoma County Sheriff's Office Sgt. Spencer Crum.

The San Francisco man faces multiple counts of attempted murder. He is in critical condition after a sheriff's deputy shot him Thursday night in Bodega Bay, a town along the Pacific coast.

Koffi, a software engineer at YouTube according to his LinkedIn page, started his bad trip while at a vacation rental with five longtime friends. He became delusional after two doses of acid, Crum said, but took two more before trying to leave the house.

Hallucinogenic fungi:Oakland in California decriminalizes magic mushrooms and peyote

Crum provided a detailed account in a news release.

To get past his friends trying to stop him, Koffi choked one, stabbed one with a pencil and punched two in the chest, side and face.

While trying to get away in his rental car, he hit the car parked behind him and lodged the sedan into the house's garage.

Koffi ran down the street before a security guard began questioning him. He stabbed the guard's chest with the metal stake end of a landscape light, then sped away in the guard's running and unlocked truck.

On the road, he hit two pedestrians. He then struck a woman walking on a bluff. After hitting a wall, he drove through the side yard of a home and got back on the road in time for two patrol cars to pull up.

Koffi accelerated toward the officers, ramming into one patrol car as a deputy fired a gun. He didn't stop until he was shot at least three times through the windshield.

Santa Rosa Police, along with the county sheriff's office and district attorney's office, are investigating the incident. The security guard and two pedestrians were hospitalized. All three are expected to survive.

Koffi is under arrest at the hospital for two counts of attempted murder, three counts of assault with a deadly weapon and one charge of carjacking.

'Their own demons':U.S. deaths from alcohol, drugs and suicide hit highest level since record-keeping began

According to his LinkedIn page, Koffi attended Stanford University and worked at Microsoft before starting at YouTube in November. Google, which owns YouTube, did not immediately respond to requests for comment.

A hallucinogenic drug, LSD can distort a person's ability to recognize reality and think rationally, according to the National Institute on Drug Abuse.