Germany's Chancellor Olaf Scholz on Monday urged restraint by Israel after it successfully repelled Iran's unprecedented drone and missile attack.

"Everyone agrees that the way in which Israel managed to successfully repel this attack… is really impressive," said Scholz.

"That is a success that should not be given away, and therefore our advice is to contribute to de-escalation."

Speaking in Shanghai during a three-day visit to China, Scholz also hit out at the "brutal Iranian attack" and said Tehran "must stop this aggression".

Scholz will travel to Beijing on Tuesday, when he is due to hold talks with China's President Xi Jinping as well as Premier Li Qiang.