The SD40-2 was introduced in January 1972 as part of EMD's Dash 2 series, competing against the GE U30C. Although higher-horsepower locomotives were available, including EMD's own SD45-2, the reliability and versatility of the 3,000-horsepower (2,200 kW) SD40-2 made it one of the best-selling models in EMD's history, edged out only by the GP9, and was the standard of the industry for several decades after its introduction. The SD40-2 was an improvement over the SD40, with modular electronic control systems similar to those of the experimental DDA40X.
Peak production of the SD40-2 was in the mid-1970s. Sales of the SD40-2 began to diminish after 1981 due to the oil crisis, increased competition from GE's Dash-7 series and the introduction of the EMD SD50, which was available concurrently to late SD40-2 production. The last SD40-2 delivered to a United States railroad was built in July 1984, with production continuing for railroads in Canada until 1988, Mexico until February 1986, and Brazil until October 1989.
The SD40-2 has seen service in Canada, Mexico, Brazil and Guinea. To suit export country specifications, General Motors designed the JT26CW-SS (British Rail Class 59) for Great Britain, the GT26CW-2 for Yugoslavia, South Korea, Iran, Morocco, Peru and Pakistan, while the GT26CU-2 went to Zimbabwe and Brazil. Various customizations led Algeria to receive their version of a SD40-2, known as GT26HCW-2.