A muscle cramp is a strong, painful contraction or tightening of a muscle that comes on suddenly and lasts from a few seconds to several minutes. It often occurs in the legs. A muscle cramp is also called a charley horse. Nighttime leg cramps are usually sudden spasms, or tightening, of muscles in the calf.