The decision to equip West German police with an advanced 9mm service pistol and replace existing 7.65mm-caliber weapons was prompted after the 1972 Munich Olympics Massacre.The new firearm was to meet the following requirements: chamber the 9x19mm Parabellum cartridge, weigh no more than 1,000 g (35 oz), the pistol's dimensions would not exceed 180 x 130 x 34 mm, it should have a muzzle energy of no less than 500 J and a service life of at least 10,000 rounds. The pistol was also to be fully ambidextrous, safe to carry with a loaded chamber and able to be quickly drawn and ready to fire instantly. As a result of a competitive bid the German police forces selected three different pistols into service: the Swiss SIG-Sauer P225 (designated the P6) and two German designs—the P7 (officially designated the PSP) and the Walther P5.
Series production of the P7 started in 1979. Shortly after, the pistol was adopted by the German Federal Police's counter-terrorism unit (GSG 9) and the German Army's special forces formations. The P7 was produced primarily by H&K but also under license by the Greek defense firm Hellenic Arms Industry as well as in Mexico by the Departamento de Industria Militar (DIM), as a sidearm for general officers and staff. The pistol was also exported to several countries.