Four people have died and two others were injured after two incidents in southern Germany yesterday which culminated in a woman opening fire in a hospital.

Police said they were investigating the shooting at the Sint Elisabethen hospital in Lörrach, in the south-west of the country, and an explosion earlier at a nearby apartment block in which the bodies of a man and a child were found.

Officials confirmed the shooting and said that the woman had opened fire at the hospital with an automatic weapon, killing one person and wounding a member of hospital staff and critically injuring a policeman.

The woman, who has not been named, is thought to have been shot dead after turning her gun on officers.

Police said they were investigating a connection between the two incidents. Shots were heard following the explosion and witnesses reported seeing a woman armed with a gun running out of the block.

The police said the woman opened fire in the gynaecology unit of the hospital and according to local reports managed to fire off several rounds during the incident.

Speaking to Germany's national public television station, ZDF, Lörrach prosecutor Dieter Inhofer said: "There was a very heavy exchange of gunfire in the hospital that had the potential to be very dangerous, but based on what we know right now … no one else was injured."

Police, who arrived within 15 minutes of the shooting, said they had sealed off the area. A motive for the shooting has not yet been established but at a news conference, German prosecutors said a domestic dispute may have triggered the shooting.

The incident comes amid debate over the tightening of gun ownership in Germany and three days after Jörg Kretschmer, the father of a German teenager who killed 15 people on a shooting spree at his former Stuttgart school last March before killing himself, went on trial for violating German gun laws. The 51-year-old businessman is accused of failing to keep his 9mm Beretta pistol secure.