The gunman shouted "free Palestine," authorities said, with U.S. and Israeli leaders expressing shock and outrage over the killings.