Berlin, Germany (CNN) -- Authorities in southwest Germany were looking for a motive Monday in an apartment building fire and a hospital shooting that, together, killed four people and are believed to be linked.
Two bodies -- one of a man and another of a 5-year-old boy -- were found inside a burning building in the city of Loerrach, police said Sunday evening.
As authorities responded to the fire, they saw a woman -- armed with weapons -- run from the building toward a hospital.
On the way, the woman -- later identified as a 41-year-old lawyer -- shot two passers-by, severely wounding them, police said.
At the St. Elisabethen hospital, the woman stabbed and shot a male nurse, killing him before police fatally shot her, authorities said.
A police officer was also seriously injured in the attack at the hospital.
Police later said the bodies in the apartment belonged to the woman's ex-husband and their son. Residents heard gunshots in the building shortly before it went up in flames, authorities said.
Firefighters evacuated 19 people from the building. Seventeen suffered mild injuries, officials said.
CNN's Claudia Otto also contributed to this report