"mass terror," 1708, from earlier adjective (c. 1600, modifying fear, terror, etc.), from French panique (15c.), from Greek panikon, literally "pertaining to Pan," the god of woods and fields, who was the source of mysterious sounds that caused contagious, groundless fear in herds and crowds, or in people in lonely spots.
In the sense of "panic, fright" the Greek word is short for panikon deima "panic fright," from neuter of Panikos "of Pan." Meaning "widespread apprehension about financial matters" is first recorded 1757. Panic button in figurative sense is first recorded 1955, the literal sense apparently is from parachuting. Panic attack attested by 1970.