A gunman killed two people, including himself, and critically wounded two others in a court house in the southern German town of Landshut on Tuesday, police and politicians said.
Police spokesman Leonard Mayer told N-TV television he believed the gunman had gone from room to room in the building but the shooting spree was over and authorities believed the gunman was among the dead.
"According to my information there are two people dead," Mr Mayer said.
"The situation is now all under control and the shooter is not on the loose. He probably killed himself but that is not yet confirmed."
Bavarian state premier Horst Seehofer said he understood that two further people were in a critical condition and that the attacker was a 60-year-old man from Dingolfing, a nearby town in Bavaria.
"It could have been an inheritance dispute," said Mr Seehofer at an event in Berlin.
N-TV reported the man had been sitting in the public area of the court room before he suddenly stood up and started shooting.
Mr Mayer said he was unaware of any warning: "It came out of the blue."
The shooting, which started at 10.15am, took place less than a month after a school massacre in the southwestern town of Winnenden in which a total of 16 people were killed.
Landshut is a town of around 62,000 in southern Bavaria.
Reuters