The authorities identified a 41-year-old lawyer as the woman thought to have first killed her ex-partner and their five-year-old son before heading to a nearby hospital armed with a pistol and a knife. After murdering an orderly and wounding a police officer, she was killed in shoot-out with the police.
The authorities said the woman likely went on the rampage following a relationship dispute. She apparently set off an explosion at an apartment building where her ex and their son lived in Lörrach, which lies in Baden-Württemberg near Germany's borders with France and Switzerland.
"It is suspected that relationship problems sparked this," Lörrach state prosecutor Dieter Inhofer said, adding that there was no outstanding legal proceedings between the two parents over custody of their son.
Autopsies on Monday revealed that she shot the man before the apartment was rocked by the blast. Her son was also dead beforehand, but the authorities could not say how he had been killed.
"The child has no gunshot wounds but there are signs of brute force. But the exact cause of death has yet to be determined in an autopsy," Uwe Schlosser, chief prosecutor from state capital Stuttgart, told the same press conference.
Fifteen others were injured in the explosion, which authorities believe was started with some kind of fuel after finding a canister.
After leaving the scene of the explosion, the woman then used a small-calibre pistol to shoot at two people. One was hit in the back, while the other suffered a grazing shot to the head.
She then headed to the Saint Elizabeth hospital in the city centre and entered the gynaecological ward. There she killed an orderly with a knife and shots to the head.
"We believe that it was a random encounter," a police spokesman said.
One police officer, who happened to be in the hospital as the woman began shooting, suffered serious injuries. The woman also attacked the officers arriving on the scene before she was shot and killed.
Wolf Hammann, head of Baden-Württemberg's state police, said on Monday that the entire incident had lasted 40 minutes from the explosion to the last shot fired.
"Thanks to their courageous intervention the police officers on duty kept it from being much worse," he said.
The authorities also said the woman had been a recreational shooter who had owned several weapons. They found over 100 rounds of ammunition at the hospital, news agency DPA reported.
Authorities in the sleepy town of 48,000-strong people near the Black Forest said it remained unclear why the woman went to the hospital, but pointed out that she had suffered a miscarriage there in 2004.
"We don't know if that's the reason. We can only report that this is part of the the woman's biography," said state prosecutor Inhofer.
The incident came only days after the trial opened in nearby Stuttgart last week against the father of Tim Kretschmer, the teenager who in March 2009 shot dead 15 people before killing himself at his old school and nearby.
Jörg Kretschmer, a 51-year-old businessman, is accused of having violated gun laws because his 17-year-old son was able to take his 9mm Beretta pistol from his bedside for the killing spree in the town of Winnenden.
Emergency services in Baden-Württemberg were well prepared thanks to events in Winnenden, and almost 400 members of the emergency services were in action on Sunday night, including 150 police and 120 from the fire brigade.
Many of those involved in the operation, as well as patients in the hospital, were receiving counselling on Monday.
The fire brigade evacuated seven people from the blazing apartment block and a further 12 from an adjacent building. In total, 17 people received with light injuries.