"Tragically, this is not the first loss of lives that we have seen in recent months. Too many Israelis have died, too many Palestinians have died," Obama told reporters at the White House.
"Obviously, we condemn in the strongest terms this attack," he said, adding that US Secretary of State Joh Kerry had spoken to Israeli Prime Minister Benjamin Netanyahu by telephone.
Separately, the White House issued a statement from the president.
"At this sensitive moment in Jerusalem, it is all the more important for Israeli and Palestinian leaders and ordinary citizens to work cooperatively together to lower tensions, reject violence, and seek a path forward towards peace," Obama said.
Obama identified the three Israeli-Americans who died in Tuesday's attack by two Palestinians armed with a gun and meat cleavers as Aryeh Kupinsky, Cary William Levine and Mosheh Twersky
Signup to our newsletter and follow us on Facebook and Twitter!
"There is and can be no justification for such attacks against innocent civilians," he said.
"The thoughts and prayers of the American people are with the victims and families of all those who were killed and injured in this horrific attack and in other recent violence."
The fourth Israeli victim has been identified as a British national. Eight more people were wounded.
The attack began shortly before 7:00 am (0500 GMT) when assailants burst into a Jewish seminary in Har Nof. Police exchanged gunfire with the attackers, killing them. Two police were wounded, one critically.