The first designs submitted to the Heer (German Army) featured a locked breech and a hidden hammer, but the Heer requested that it be redesigned with an external hammer.The final developmental stage in the P38's design history was the
Modell MP/H (indicating exposed hammer). Apparently only a few were
produced before the army adopted the HP
in 1938 (Modell Heeres Pistole—Model Army Pistol). The production
relationship between the HP and the almost simultaneous P38 (Pistole
1938) is unclear and quite confused.The P38 concept was accepted by the German military in 1938 but
production of actual prototype ("Test") pistols did not begin until late
1939. Walther began manufacture at their plant in Zella-Mehlis
and produced three series of "Test" pistols, designated by a "0" prefix
to the serial number. The third series pistols satisfactorily solved
the previous problems for the Heer and mass production began in mid-1940.Early P38s were almost identical to the HP (which continued to be
produced for "commercial sales," i.e., to well-connected Nazis). The
major differences were different slide markings, an external extractor,
the HP's rectangular firing pin was replaced by one with a round tip, a
different configuration for the locking lever and slide stop lever on
the left side, and a re-configuration of the grip panels.It is interesting to note that in 1944 the cost of one complete P38
was $14.08, while the cost of one complete P08 Luger was $19.80. The
commercial retail price of the Model HP during this time was $75.Several experimental versions were later created in .45 ACP, and .38 Super, but these were never mass-produced. In addition to the 9 mm Parabellum version, some 7.65×21mm Parabellum and some .22 Long Rifle versions were also manufactured and sold.

The Walther P38 was in production from 1938 to 1963. From 1945 to
1957, no P38s were produced for the German military. Slowly over time,
West Germany desired to rebuild its military so that it could shoulder
some of the burden for its own defense. Walther retooled for new P38
production since no military firearms production had occurred in West
Germany since the end of the war, knowing that the military would again
seek Walther firearms. When the Bundeswehr
announced it wanted the P38 for its official service pistol, Walther
readily resumed P38 production within just two years, using wartime
pistols as models and new engineering drawings and machine tools. The
first of the new P38s were delivered to the West German military in June
1957, some 17 years and two months after the pistol had initially seen
action in World War II, and from 1957 to 1963 the P38 was again the
standard sidearm.In late 1963 the postwar military model P1 was adopted for use by the
German military, identifiable by the P1 stamping on the slide. The
postwar pistols, whether marked as P38 or P1, have an aluminum
frame rather than the steel frame of the original design. The aluminum
frame was later reinforced with a hex bolt above the trigger guard.The last death penalty in Germany was conducted with a variant of the Walther P38 with a silencer in East Germany on June 26 in 1981. During the 1990s the German military started replacing the P1 with the P8 pistol and finally phased out the P1 in 2004.An improved version of the P38, the Walther P4, was developed in the
late 1970s and was adopted by the police forces of South Africa, Rhineland-Palatinate and Baden-Württemberg.