Sgt. Andrew Finneran, a 101st Airborne Division infantryman, fires a Sig Sauer pistol during weapons training May 29, 2015, at Tactical Base Gamberi in eastern Afghanistan. The pistol shown here is not the Sig P320, but a 229. (U.S. Army photo by Capt. Charlie Emmons, TAAC-E Public Affairs)

After more than two years of searching, the Army has finally settled on the pistol that will replace the branch’s nearly 32-year-old sidearm.

The up-to $580 million contract for the “Modular Handgun System” has been awarded to Sig Sauer, a German firearms company, according to a release from the Army. The Army’s aging 9 mm M9 Beretta will be replaced by a variant of Sig’s P320 pistol.

[Why the Marines have failed to adopt a new sniper rifle in the past 14 years]

Though the Army did not name the specific pistol in its announcement, a Sig representative at a firearms exposition in Las Vegas confirmed that it was the P320 to Military.com.

“By maximizing full and open competition across our industry partners, we have optimized private sector advancements in handguns, ammunition and magazines and the end result will ensure a decidedly superior weapon system for our warfighters,” said Army Acquisition Executive Steffanie Easter in an emailed statement.

The Army officially began its search for the new pistol in 2011 and, in the last year, slowly whittled a field of 12 competitors down to three companies, including Glock and Sig Sauer.

Beretta, an Italian weapons company, had offered an upgraded version of the current M9 pistol once the Army announced it was looking to upgrade, but the proposal was rejected.

The Sig was lauded as an early favorite in the final competition by firearms experts because it was the only truly “modular” pistol in the running. Bob Owens, from the weapons blog Bearing Arms, wrote in June that “only the Sig Sauer P320, with a serialized core frame and the ability to swap different grip lengths and slide-barrel combinations, seems to meet the requirements … among the named designs.”

That means that while the other pistols in the running could swap some parts and take attachments such flashlights and lasers, the Sig was the only one in the mix that could, say, easily switch from a 9 mm to a .45-caliber pistol with a few parts changes. The ability to switch calibers has been a growing feature in U.S. military weapons programs. Those systems, however, such as the SCAR series of rifles and the Precision Sniper Rifle program, are relegated to Special Operations forces.

Since the M9 was first fielded in the 1980s, pistol design and ergonomics have changed. Polymer pistols, such as the Austrian-made Glock line, have become increasingly popular among military units and law enforcement agencies worldwide. Even though the M9 is considered accurate and sturdy, it has been decried by some combat troops in recent years because of its size, weight and tendency to require frequent cleaning in desert environments. While the M9 is being phased out by the Army, it is still in use in the Navy, the Marine Corps and the Air Force. The Air Force, however, is in the midst of its own search for a new modular handgun.

Special Operations forces use a variety of pistols. Navy SEALs have used the Sig Sauer P226 for years but could soon be changing to a Glock, while Marine Special Operations Command is changing from its specially designed .45-caliber pistol to a Glock as well. Advances in ammunition design have made arguments over which caliber is better suited for combat increasingly difficult. The FBI, however, long considered the arbiter of the pistol caliber debate, recently decided to go back from the larger .40-caliber to the 9mm.

Read more:

The Army’s elite Ranger Regiment will soon have its first female soldier

Inmates made defective combat helmets for U.S. troops — and no one was prosecuted

U.S. Special Operations units are using faulty rifle sights