President Clinton signed the Brady bill, which imposes a nationwide waiting period for the purchase of handguns, into law yesterday during a White House ceremony that rippled with the politics of gun control and the passion of hundreds of Americans who marked the successful end to a seven-year fight.

Sarah Brady, flanked by her husband for whom the legislation is named and their 15-year-old son, Scott, saluted two presidents for providing the political leadership to get the legislation passed: former president Ronald Reagan at the start and Clinton at the end.

Reagan, who opposed most gun control legislation until well after he was wounded in a 1981 assassination attempt that also seriously wounded then-White House press secretary James S. Brady, "made it a badge of honor for Republicans" to support the legislation, Sarah Brady said. And Clinton, she said, made the legislation a reality by publicly pledging during his campaign and after he took office to sign it.

Brady, reading from his wheelchair a text held by his wife, said the legislation would bring "the end of unchecked madness and the commencement of a heartfelt crusade for a safer and saner country." He recalled the day 12 years ago when "my life was changed forever by a disturbed young man with a gun." Too many young people, he said, "believe that a gun is the answer to their problems. I can tell them it is not. I can tell them about the pain and the frustration. I hope they will listen."

The signing was a symbol of one of the sharp changes from the previous administration. The Bradys received no support and little encouragement from the Bush administration, and for much of President George Bush's tenure, neither could get a foot in the door of the White House. Bush maintained what had been a traditional Republican opposition to gun control by the party's presidential candidates.

The Bradys ended up endorsing Clinton in the 1992 campaign. The National Rifle Association (NRA), leader of the gun control opposition, did not publicly back either party's nominee.

The Brady legislation, which requires a five-day waiting period during which local police are required to conduct a criminal background check of prospective handgun buyers, will take effect in 90 days. A version of it was first introduced in 1987 by then-Rep. Edward F. Feighan (D-Ohio), and since then, Clinton noted, more than 150,000 Americans have been killed by handguns.

When Clinton signed the bill, the crowd of 200 police officers and legislators, citizen activists and mayors and governors erupted in loud cheers and calls unusual in their exuberance in the stately ceremonial East Room.

Before the signing, Clinton called the legislation "step one in taking our streets back," and recounted his commitment to protect sportsmen from intrusions on their use of guns without allowing anti-gun control forces to use sportsmen as a front. "I come from a state where half the folks have hunting and fishing licenses," Clinton said, recounting his first attempt as a boy to shoot a .22 at fencetop cans and pulling the trigger on a shotgun as a youth.

"We have taken this important part of the life of millions of Americans and turned it into an instrument of maintaining madness," he said, "Would I let anybody change that life in America? Not on your life. Has that got anything to do with the Brady bill or assault weapons? Of course not."

The president was also clear on the politics of the legislation, offering a "special word of thanks" to members of Congress who supported the legislation "when there was some considerable political risk either attached to it, or thought to be attached" or who come from districts where gun control votes are particularly risky because of NRA influence.

In a shaky voice, Melanie Musiick of Atlanta told the crowd that not only politicians and the famous had fought for the legislation. Noting that she was not a politician or citizen activist, she recounted how her husband was killed in 1990 by a man who had just left a mental institution and purchased a gun outside Atlanta to avoid Atlanta's waiting period.

"The Brady bill could have saved my husband's life," she said in explaining her efforts to help obtain passage of the legislation.

The legislation authorizes spending $200 million a year to computerize criminal background information to create an instant-check system over the next five years.