The German army can use force inside the country, but only in exceptional cases and as a last resort, the country's top court has said.
The Federal Constitutional Court's decision relaxes the rules for domestic military operations, which have been tightly controlled because of Germany's history of militarism.
Previously, the government could mobilise the army to support law enforcement authorities, but the use of military force inside Germany was forbidden.
The court ruled in a majority decision that the army can use force but "only in exceptional situation of catastrophic proportions".
"The deployment of armed forces and the use specifically of military means are also only permissible as a last resort in such a situation," the judges said.
They specifically excluded demonstrations as a possible reason for military force.
Adolf Hitler ruthlessly used paramilitary organisations to suppress dissent and persecute enemies during his 12-year dictatorship from 1933 to 1945.
The court's decision did not change a 2006 ruling that the shooting down of hijacked aeroplanes is illegal. The government had argued at the time that it was necessary to give the military the power to fire at planes that were being used as terrorist weapons like in the September 11, 2001, attacks in the United States.
But the judges said shooting down a hijacked plane breached the right to life of passengers and crew aboard the aircraft.
Germany's army was given a strictly defensive role after the Second World War, but successive governments have gradually eased the rules on military operations abroad to meet the demands of the country's Nato allies. Such deployments still require approval by Parliament and the army is forbidden from taking part in offensive operations.