In the early 1970s, the PLAAF required a new fighter-bomber to replace the Harbin H-5 and Nanchang Q-5. A request was duly submitted to the Ministry of Aviation Industry (later renamed to the Aviation Industry Corporation of China), which organized a domestic development program when efforts to secure a joint venture with foreign partners failed. The program was authorized on 19 April 1983 by then-paramount leader Deng Xiaoping. The program was also aiming to make use of newly imported British Rolls-Royce Spey turbofan engines at the time.
On its maiden flight on December 14, 1988, while en route back to the airport to land, the engines of the JH-7 prototype suddenly begun to vibrate violently. The test pilot Huang Bingxin decided to make an emergency landing, but as he approached the airport, the vibration was so great that two thirds of the instruments had been shaken off the instrument panel, and all of the connectors of the remaining third still attached to the panel had also been shaken loose, so none of the instruments worked; the pilot nonetheless managed to eventually land the prototype safely.
On June 8, 1991, a JH-7 prototype suddenly began to leak fuel at a high rate. Lu Jun, a Russian trained Chinese test pilot, managed to make a safe emergency landing when the fuel reserve had dropped to slightly more than 30 liters. Lu's luck ran out approximately three years later when on April 4, 1994, a JH-7 prototype crashed during a test flight, killing him.
On August 19, 1992, the entire rudder of a JH-7 suddenly fell off at an altitude of 5000 meters, while carrying four live missiles. Against orders to jettison the missiles and abandon the aircraft, the test pilot decided to attempt an emergency landing. Using mainly differential thrust of the two engines, the test pilot Huang Bingxin made it back to the airport and attempted to make an emergency landing, but a tire at the starboard side exploded on touch down, causing the aircraft to veer off course. Using brakes as control, the test pilot made two attempts before finally releasing the drogue parachute to finally stop safely.
The JH-7A entered service with the PLANAF in early 2004, and with the PLAAF by the end of the year.
In 2007 JH-7s went abroad to participate in "Peace Mission" exercises of the Shanghai Cooperation Organization (SCO). In April 2012, multiple JH-7 aircraft joined a Russia-China joint naval exercise in eastern China. In 2013, JH-7s participated in a Russia-China joint exercise held in Russian territory.