More than two decades before Newtown, there was Stockton.

In January 1989, a troubled drifter in his 20s opened fire with a semiautomatic rifle on a California elementary school yard packed with students. Five children, ages 6 to 9, were killed in the fusillade of bullets; 29 others were wounded, along with one teacher.

The resulting national shock and outrage plunged Congress into a debate over whether to ban military-style assault weapons.

“The American people are fed up with the death and violence brought on by these assault weapons,” Senator Howard M. Metzenbaum, an Ohio Democrat, declared on the Senate floor. “They demand action.”

Action, however, would take time. The gun lobby put up roadblocks. The politics, just as today, were fraught. It took five years of legislative slogging to pass a federal assault weapons ban that finally took effect in 1994. But the price of passage was a host of compromises — most painfully for supporters, a sunset provision added late in the legislative wrangling that paved the way for the measure to expire in 2004.