An involuntary contraction of a muscle or group of muscles. Spasms may involve SKELETAL MUSCLE or SMOOTH MUSCLE.