This rifle came about during the Vietnam War, when the United States Marine Corps made a decision to purchase purpose-made sniper rifles (prior to this, snipers simply used accurized service rifles with a telescopic sight mounted). Remington offered their Model 40XB target rifle action (target tuned model 700 action with heavy barrel) to the USMC in April 1966 for trials. Initially, 800 rifles were offered under the designation "M40 sniper rifle", and a total of 995 M40 rifles were built by Remington. Original M40s were built on Remingtons' model 700BDL actions with one piece wooden stocks.
In the 1970s, the initial M40s began to wear out. The Marine Corps began rebuilding their M40s with polymer McMillan stocks and began using a different optic for the rifles, designating the rifle "M40A1". The M40A1s and later variants are built in Quantico by qualified USMC armorers with parts supplied by Remington (actions), Winchester (magazine floor plate) and other contractors.
Later variants (M40A3, M40A5) incorporated more improvements to the rifle.
The M40 rifle is a heavily modified Remington Model 700. It features a heavy, accurized barrel and a "short action" (for a Remington model, the distance between the receiver screws is 6.5 inches; this means it cannot accommodate longer cartridges such as the .30-06 or .270 Winchester).