German chancellor Olaf Scholz said on Saturday he was "deeply shocked" by the "terrible" attacks in Jerusalem.
"There have been deaths and people wounded in the heart of Israel," he said, referring to an attack on a synagogue on Friday that killed seven and another on Saturday morning in which two people were injured.
The shootings came after nine Palestinians were killed in an Israeli army operation in the Jenin refugee camp, in the occupied West Bank.
"My thoughts are with the victims and their families. Germany stands by the side of Israel," Scholz tweeted.
Earlier, the German foreign ministry said it also deplored Friday's "abominable" attack, which took place on International Holocaust Remembrance Day.
"A dialogue and cooperation between Israel and the Palestinian authorities are more necessary than ever in order to eliminate terror," a spokeswoman for the ministry said.
"The spiral of violence that has already caused too many casualties on both sides this year must not continue."
On Friday evening, a 21-year-old Palestinian man shot and killed seven people near a synagogue in east Jerusalem during Shabbat prayers, before being shot dead after a chase.
And on Saturday morning, two people, a father and his son were injured in east Jerusalem by a 13-year-old Palestinian boy.
On Thursday, Israeli forces killed nine Palestinians during a raid on the crowded Jenin refugee camp.
A panel of independent United Nations human rights experts said the death toll from Thursday's raid marked "the highest number of people killed in a single operation in the West Bank since 2005".