Plans to open a military installation in San Marcos began in 1942. The site chosen for San Marcos Army Air Field was six miles east of town on State Highway 21 in Caldwell County. The city of San Marcos raised $100,000 to purchase 500 acres of land, and the federal government arranged for the purchase of another 1,500 acres. Construction began in late summer 1942, and the field was completed on December 15 of that year. The mission of the new installation was navigator training, and the first unit to occupy the field was the 2536th Army Air Forces Base Unit, commanded by Lt. Col. John F. Hutchison. The first class of trainees arrived on February 13, 1943. With classes arriving about every three weeks, by September 1945, when the navigator mission ended, roughly 10,000 navigators had been trained.
Deactivation of the field was imminent after the navigator-training mission ended. However, due in large part to the efforts of Representative Lyndon B. Johnson and Senator Thomas T. Connally, the field was kept open. In May 1946 the field began training helicopter pilots. The 3586th Liaison-Helicopter Pilot Training Squadron was transferred from Wichita Falls to San Marcos Army Air Field. In 1947 the name of the field was changed from San Marcos Army Air Field to San Marcos Air Force Base. The 3586th moved to Waco in 1949, and the base was declared inactive in October 1949. It was reactivated in January 1951, and the 3585th Pilot Training Squadron arrived on February 1, 1951; Col. William F. Stewart commanded the base. With twenty-one squadrons assigned to the base and over 4,800 personnel, San Marcos Air Force Base was the largest training operation for air force helicopter pilots in the United States. Pilot training was provided for both army and air force helicopter pilots and maintenance training for army and air force enlisted mechanics. A number of cadets from the Royal Norwegian Air Force trained at the field in 1952. The early 1950s, when the monthly operations budget was over $2 million, was the most active time for the base. On May 16, 1953, the base was renamed Gary Air Force Base in honor of 2d Lt. Arthur Edward Gary, the first San Marcos resident killed in World War II. Gary was killed when Japanese bombers attacked Clark Field in the Philippines on December 7, 1941.
Gary AFB was transferred to the army in 1956 and became Camp Gary. At the time of its closure in December 1963, the base consisted of 2,282 acres, 750 buildings, 1.7 million square feet of floor space, barracks space for 1,100 men, family housing for 108 families, five runways, and seven taxiways. The site is now used by the San Marcos Airport and by the Gary Job Corps Center.