A gunman has killed one person and injured three others in a shooting inside Heidelberg University in southwestern Germany, police said, adding that the perpetrator was now dead.

The man opened fire with a long-barrelled firearm in a lecture hall and then fled outside, police said.
The man opened fire with a long-barrelled firearm in a lecture hall and then fled outside, police said. (AP)

A gunman has stormed a lecture hall at Heidelberg University in southwestern Germany, killing a young woman and injuring three others before fleeing the scene and turning the weapon on himself.

The man fired shots "wildly" around the amphitheatre, a police spokesman told AFP News Agency on Monday.

All four victims were "seriously injured", police said. One of them later succumbed to her wounds in hospital, security sources told AFP.

German media reported that the gunman had killed himself and that he appeared to have no religious or political motive.

The man opened fire with a long-barrelled firearm in a lecture hall and then fled outside, police said. 

Police stressed that they believe he was acting alone and there was no longer any danger.

READ MORE: Shooting targets mosque in Germany

Earlier, police said a large deployment of police and emergency services was on the scene at the Neuenheimer Feld area of the town, which is home to university facilities.
Earlier, police said a large deployment of police and emergency services was on the scene at the Neuenheimer Feld area of the town, which is home to university facilities. (AFP)

Top-ranking university

The shooting triggered a major police operation at the university's Neuenheimer Feld campus.

Earlier, police on Twitter urged people to steer clear of the area "so that rescue workers and emergency services can travel freely".

Students were also told to keep away from the campus in an email from the university, local broadcaster SWR reported.

Heidelberg is a picturesque university town in the state of Baden-Wuerttemberg, home to a population of around 160,000 people.

Heidelberg University, founded in 1386, is Germany's oldest university and one of the top-ranking in Europe.

School shootings are relatively rare in Germany, a country with some of the strictest gun laws in Europe.

Source: TRTWorld and agencies