Officials said that terrorism was ruled out as a motive during preliminary investigations.