Three people are dead after a gunman opened fire at a bar and a home near the Penn State University campus, according to police.

Chief John Gardner said the suspected 21-year-old killer shot dead “a girlfriend or ex-girlfriend” at PJ Harrigan’s Bar & Grill in the Pennsylvania town of State College at around 10.30pm local time on Thursday.

Two other people at the bar-restaurant, located inside the Ramada Hotel, were shot and critically wounded.

The gunman then fled the scene, crashed his car on Waupelani Drive, before breaking into a nearby home and shooting dead a man inside.

The victim’s wife locked herself in the bathroom and called the police. The suspect shot himself in the face and was dead by the time officers arrived at the scene, according to Chief Gardner.

The shooter was a 21-year-old white male from the nearby town of Bellfonte. Police confirmed he was the only gun attacker on Thursday night.

Chief Gardner told reporters the two victims wounded at the bar-restaurant, one male and one female, were taken to Mount Nittany Medical Centre.

“The suspect, the shooter, left this area in a car and subsequently crashed that vehicle up on Waupelani Drive, at that particular point up there. He then entered a residence on Tussey Lane up there and broke his way in, may even have shot his way in, we’re still trying to piece that together.

The police chief added: “He shot a male individual … His wife was present, but she locked herself in a bathroom and called 911. By the time our officers got there, the perpetrator had shot himself in the face and was deceased.”

Although Penn State University later acknowledged the incident in a tweet, some students expressed frustration the college had failed to alert them about an active shooter near the campus.

Earlier in the day the college had sent out an alert about snow when the wintry conditions caused afternoon classes to be cancelled.