The Pentagon recognized that the Soviet Union was developing an advanced interceptor, which would eventually be revealed as the Mikoyan-Gurevich MiG-25 Foxbat. This aircraft could fly over Mach 2.8 with a service ceiling near 80,000 feet.
To address this threat, the United States Air Force sought to replace its existing interceptors with more capable ones. Initially considering the North American XF-108 Rapier, which was canceled in 1959, they turned to Lockheed's Kelly Johnson. Johnson proposed modifying the A-12 for military use. In response, three prototypes were ordered in 1960.
Designated as YF-12A, these prototypes required significant modifications to launch air-to-air missiles. "The aircraft's nose had to be redesigned to fit a new fire-control radar," according to Air Force Magazine. Additional modifications included an extra cockpit for a radar operator and converting reconnaissance equipment bays into missile launch bays.
The YF-12 first flew on August 7th, 1963. President Lyndon B. Johnson publicly revealed it on February 24th, 1964, without mentioning its A-12 origins due to CIA classification concerns.
By 1965, optimism surrounded the program when an order for 93 F-12B production models was placed by the Air Force; however, funding delays occurred due to Vietnam War budgetary pressures.
Ultimately, by late 1960s defense strategies shifted towards surface-to-air missile systems instead of interceptors like YF-12A: "In January 1968," NASA reports that "the YF-12 program was officially canceled."
Despite cancellation two prototypes found new life within NASA’s Flight Research Center testing programs after their initial purpose had ended abruptly before full-scale production began.