GOLETA, Calif. (AP) â?? A drive-by shooter went on a rampage near a Santa Barbara university campus that left seven people dead, including the attacker, and seven others wounded, authorities said Saturday.

The gunman got into two gun battles with deputies Friday night in the beachside community of Isla Vista before crashing his black BMW into a parked car, Santa Barbara County Sheriff Bill Brown said.

Deputies found him dead with a gunshot wound to the head, but it wasn't immediately clear whether he was killed by gunfire or if he committed suicide, he said.

A semi-automatic handgun was recovered from the scene near the University of California, Santa Barbara.

Investigators know the gunman's name, but Brown said he couldn't release it pending notification of relatives.

Police are investigating a disturbing YouTube video posted that shows a young man describing plans to shoot women, which they say appears to be connected to the attack. Police would not say whether the person in the video was a suspect in the shooting.

"We're analyzing both written and videotaped evidence that suggests that this atrocity was a premeditated mass murder," Brown said.

The shootings started around 9:30 p.m. in the student enclave reputed for parties, including an annual spring bash that turned into a violent blowout last month. Brown said the shootings occurred at several sites, resulting in nine crime scenes.

A student told KEYT-TV he saw shots fired from a BMW, fatally striking one woman and critically injuring another woman.

A visibly shaken student told the station she was approached by the driver of a black BMW who flashed a handgun and asked "Hey, what's up?" The student, who didn't provide her full name, said she thought he was carrying an airsoft gun and kept walking. She said seconds later, she felt something buzz by her head and quickly realized they were bullets.

The victims' identities were not immediately released. Brown said the injured were being treated for gunshot wounds and traumatic injuries, including at least one person who underwent surgery for life-threatening injuries.

Isla Vista, a roughly half-square mile community next to UC Santa Barbara's campus and picturesque beachside cliffs, is home to 23,000 people. The area has a reputation for excessive partying. Last month, an annual spring bash spiraled into violence as young people clashed with police and tossed rocks and bottles. A university police officer and four deputies were injured and 130 people were arrested.

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.