The FBI is investigating the shooting as a possible ideologically motivated act of terrorism, the sources said.