The gunman in a mass shooting at a San Francisco UPS facility wielded a TEC-9 style assault pistol, which has been illegal to own without registration or to sell since at least 2000, two sources with knowledge of the case tell The Trace.

Just before 9 a.m. on Wednesday morning, Jimmy Lam, 38, shot and killed three former coworkers and wounded two others. He was armed with the TEC-9 style pistol and a 1911-style semiautomatic handgun. When police arrived at the shipping company’s offices, just blocks from Franklin Square, Lam put the gun to his head and killed himself. The massacre was overshadowed by an assault on a baseball practice in Arlington, Virginia, on a group of Congressional Republicans that left five wounded, including House Majority Whip Steve Scalise.

The TEC-9 is an inexpensive polymer-framed pistol developed in 1985 and produced until 2001 by the Florida company Intratec. The semiautomatic gun fires 9mm bullets, the same rounds used by many police service weapons. It is considered an assault pistol because it is based on a submachine gun originally designed for the military. The TEC-9 was typically equipped with magazines that held more than 20 rounds, and sometimes up to 50.

A portion of California’s Assault Weapons Identification Guide

In the late 1980s, as crime soared in American cities, the TEC-9 quickly gained a reputation as a bad-guy’s gun. It frequently appeared in the hands of criminals on television shows like “Miami Vice”, as well as latter-day recreations of the era like the video game Grand Theft Auto: Vice City.

In 1989, California passed one of the first assault-weapons laws in the country, and banned the TEC-9 by name. The model was no longer allowed to be sold or transferred inside the state. Individuals who had obtained a TEC-9 before the ban were allowed to register their firearm with the state as an assault weapon, and keep it.

It was not immediately clear how the gunman behind Wednesday’s shooting obtained the pistol.

In response to the ban, Intratec developed the TEC-DC9, which had a slightly different barrel, and could thus be sold in the state despite being functionally identical to the TEC-9. The “DC” in the model’s name stood for “designed in California.” (Gun manufacturers and enterprising gunsmiths have a long history of subverting the state’s regulations by making minor, often cosmetic modifications to weapons).

In 2000, the state expanded its criteria for assault weapons to include guns not just by specific make and model, but by design characteristics. The updated ban applied to all pistols that accept detachable magazines in addition to features like a barrel shroud. Pistols with magazines located outside of the grip — a key characteristic of the the TEC-9 and TEC-DC9 — were also banned.

However, those who owned the weapon before that law came into effect could just register the gun and keep it. Or those who wanted one after 2000 could drive over the state line to Nevada or Arizona, where they remain perfectly legal and unregulated.

Correction: An earlier version of this article stated that the gunman used a TEC-9 assault pistol. However, the exact model of the pistol was unknown, and the gunman used a weapon in the style of the TEC-9.