Outgoing German Chancellor Olaf Scholz has said Russia's use of an experimental hypersonic missile against Ukraine was an example of "terrible escalation" and should be avoided at all costs.

The deployment of the new weapon showed “how dangerous this war is,” Scholz said in a speech, AFP reports.

"That [Russian President Vladimir] Putin has now also used a medium-range missile to strike Ukrainian territory is a terrible escalation," the German chancellor said.

It is important for Germany to work with allies “to do what prevents an escalation in this war to a war between Russia and NATO,” Scholz added.

The German chancellor said it was important to balance “prudence and clear support for Ukraine.”

“You only get that with the SPD,” he said, referring to his Social Democratic Party of Germany.