Minutes after President Reagan was shot on March 30, 1981, Special Agent Ralph P. Anthony waited nervously in his tiny office at the Treasury Department for a telephone call that he knew would come.

He didn't have to wait long.

"It's a Roehm, model RG14," the caller said, relaying information from the Secret Service about the handgun used to shoot Reagan. "Here's its serial number."

Anthony, who organized the Gun Tracing Division at the Bureau of Alcohol, Tobacco and Firearms in 1972 and has directed it ever since, quickly recognized the weapon as a cheap revolver made by RG Industries in Miami. He called the company and was told the gun had been made in 1980 and delivered to a North Carolina wholesaler. Anthony telephoned the wholesaler and discovered that the gun had been sent to Rocky's Pawn Shop in Dallas.

Anthony called the pawn shop and asked a clerk to check the store's Form 4473s, a sales record that all gun dealers are required to keep.

The gun was sold on Oct. 13, 1980, the clerk said, to a 25-year-old who identified himself as John Warnock Hinckley Jr.

Anthony glanced at his watch. It had taken 14 minutes to track the handgun from its manufacturer to the government's prime suspect.

Few of the 30,000 guns that Anthony's 16-member staff trace in an average year have been involved in such spectacular crimes. But during the last 11 years, the tracing office has been credited with helping solve several thousand crimes.

A recent department study found that 81 percent of the office's 1982 traces helped investigators solve a crime, recover stolen property or convict a suspect. Foreign governments also have asked for help. Philippine President Ferdinand Marcos asked the United States to trace the gun used by an unidentified assassin to kill his longtime political rival, Benigno Aquino Jr. The 10-year-old handgun was traced to a gun dealer in Thailand.

Local and state law enforcement officers are the office's biggest customers. Last year, for no charge, it traced 17,960 guns for them. The office traced 12,374 weapons for Treasury agents and 1,921 for other federal agencies and foreign countries. Because the office is not a line item on the agency's budget, officials said they couldn't calculate easily how much the tracing program costs each year.

To trace a gun, the office must know the manufacturer and the serial number, Anthony said. Once it gets that information, the office contacts the manufacturer and begins following the paper trail that U.S. gun dealers are required to keep.

"Some large manufacturers like Colt and Smith & Wesson have records that go back into the 1800s," Anthony said, "but we usually don't trace many weapons that were made prior to 1954."

The office will track a gun until it is sold by a dealer to a private citizen. After that, it's up to the investigators who requested the trace. Sometimes a gun used in a crime already has changed hands dozens of times. Finding each link often is impossible because private citizens are not required to keep sales records unless they regularly trade or collect guns.

But sometimes, Anthony said, investigators get lucky.

For example, a robber dropped a gun and ran in 1976 after he killed a passenger in a taxi in Arlington. Police were able to track down the gun owner, who said his son-in-law had the weapon. The son-in-law was arrested and confessed to the murder.

In another Virginia case, a state court judge in Richmond resigned and a court clerk was sentenced to five years in prison after a gun trace revealed that several weapons bought by undercover agents had come from the court's evidence vault.

About 16 percent of the guns traced during 1982 were involved in gun violations, Anthony said. Another 12 percent were used in robberies and burglaries, 7 percent came from narcotic violations, 4 percent from homicides, 3 percent from assaults and 11 percent from other crimes. Last year, the office traced 21,389 handguns, 6,021 rifles and 208 machine guns that were used in crimes.

In 1978, the bureau decided to trace guns used in crimes in 18 major cities, including Washington, to learn where criminals had obtained them. It found that most guns were purchased in three states that didn't have tough gun laws: Mississippi, Florida and Texas. It also found that most of them were "Saturday Night Specials," guns that cost less than $50 and have barrels no more than three inches long.

Noel A. Haera, the special agent in charge of the BATF's Firearms Enforcement Branch, said inflation has forced manufacturers of inexpensive handguns to raise their prices so much that "you're just as likely today to find an expensive handgun as a cheap one" at a crime scene. But agency officials said they still think many of the guns used in crimes are from southern states where handgun laws aren't strict.

The number of handguns made in the United States has increased steadily since 1978, according to BATF records. U.S. manufacturers produced 2.6 million handguns last year, 1.6 million rifles and 878,568 shotguns, bringing the total number of guns made in the United States since 1970 to 65 million. American gun makers also exported 446,865 guns in 1982, bringing the export total since 1970 to 4.8 million.

Just how many Americans own firearms is unknown, in part because many weapons are handed down for several generations. "One of the things you learn in this business," Haera said, "is that a gun can have an almost endless life. It's not unusal for us to run across guns that are 20, 30 or 40 years old."

While the tracing program is popular with law enforcement officers, gun-owners groups generally have criticized it, contending it could lead to a federal gun registration program. In 1980, Congress prevented the BATF from setting up a tracing program for explosives after dynamite manufacturers and gun-owner groups opposed the idea.

Meanwhile, the gun tracing office's reputation has caused some criminals to worry. In 1979, a Florida sheriff asked the office to trace a revolver taken from a burglar. It traced the gun to the suspect's home town. The suspect confessed and helped the sheriff solve 161 burglaries and arrest three other people.

What the suspect didn't learn until it was too late, Anthony said, was that agents had lost track of the gun after they traced it to the suspect's home town and couldn't have linked it to him.