The Beretta M9 was adopted in 1985 as the replacement for the Colt M1911A1 in .45 ACP. It narrowly beat out the SIG Sauer P226, mainly due to cost reasons as Beretta came in at $1 less per pistol. The M9 was chosen at a time when the decision was made to switch to a large capacity 9mm pistol that could be standardized with NATO.
The Beretta M9, or the 92FS for the civilian market, has proven to be an excellent pistol. Early issues were sorted out and the pistol has served in all major conflicts the US has been involved in since then.
The M9 is a double action single action pistol with a 15 round magazine. The design is based very heavily off of the proven Walther P38, which serve as the German army sidearm from 1938 up until 2004. Later versions of the M9 included the M9A1, which came with a picatinny rail on the frame for the Marine Corps, and the M9A3, which Beretta had hoped would succeed the original M9, but was instead replaced by the SIG Sauer M17.