A program that imposes automatic five-year sentences on felons caught carrying guns is being credited by Richmond police with helping to cut dramatically the city's homicide and armed robbery rates.

The program, under which authorities generally prosecute gun cases as federal crimes -- ensuring stiffer bond rules and tougher sentences -- is known as Project Exile and has received high marks from two unlikely allies: Handgun Control Inc. and the National Rifle Association.

The federal prosecutor's office here is one of only a handful in the nation -- Boston and Philadelphia are two others -- to launch an experimental attack on gun crimes. The idea behind the program, authorities say, is to get guns out of the hands of those who are carrying them illegally, people who are most likely to use the weapons in other crimes.

In Richmond, which in recent years has had one of the nation's highest homicide rates, authorities credit Project Exile with helping to reduce gun-related homicides dramatically. Police say there were 140 gun-related homicides last year; so far this year there have been 34. Gun-related armed robberies, meanwhile, are down by a third.

On a morning talk show Sunday, NRA President Charlton Heston told a national television audience that "in less than a year, they reduced deaths, murders, in the city of Richmond by half" through the Exile project.

Handgun Control Chairman Sarah Brady, in a letter to the U.S. attorney here, said: "Your work is succeeding in getting guns out of the hands of criminals. . . . The results in Richmond are impressive."

Cynthia L. Price, a Richmond police spokeswoman, said Exile has had a profound effect on the number of violent crimes and the nature of those offenses, leading to far fewer instances in which guns are drawn in anger.

"It's a great program," Price said.

So how did Exile help cut homicides and armed robberies? A cadre of aggressive federal prosecutors, including a lead attorney who earned his spurs hounding Mafia dons in New York City, determined that Richmond's number one crime problem was similar to that plaguing Washington: street-level violence fueled largely by an evidently insatiable appetite for weaponry.

They then brought to bear on city gun cases the full force of the federal government, using statutes dating from the late 1960s to seek mandatory minimum prison sentences of five years for gun-related crimes. That expedited many of the gun cases, ensuring stiffer penalties and, in many cases, eliminating parole.

In some instances, steering a local criminal into the federal system was as simple as a Richmond police officer paging the federal Bureau of Alcohol, Tobacco and Firearms to double-check for federal gun violations, such as the obliteration of serial numbers on weapons, use of a gun while possessing a controlled substance or possession of guns by fugitives.

Several federal judges here have complained that their caseloads now seem to resemble reruns of the "Night Court" television show, but city officials and community leaders delight in the lower homicide rate.

In the year that ended last week, 363 guns were seized, 191 of 251 of those arrested on gun violations were convicted, and 137 of those were sentenced to an average of 56 months in jail.

James B. Comey, the executive assistant U.S. attorney who helped craft the Exile program, said the numbers in part reflect the unusually large number of people who were carrying guns in Richmond.

"Richmond is a weird place," he said. "The world is flooded with guns here."

Comey, a tall, boyish prosecutor who spins hair-raising tales about his Mafia wiretapping days in New York, said the gun "carry" rate -- the number of times police confiscate a gun when arresting suspects -- has dropped from 135 a month to 67.

"It's an amazingly high carry rate," he said. "I've never seen a place like Richmond. Dealers in cities like Chicago, New York or Cleveland have access to guns, but they're not standing on a street corner with a gun!"

Of Project Exile, he added: "It's a cultural war. It's totally apolitical. It's about locking up criminals with guns."

Gun violence has long plagued Richmond, sending its homicide rate higher than the District's several years this decade. In the fall of 1994, for instance, Richmond passed its previous homicide record, outpacing every city in the country except New Orleans.

S. David Schiller, the senior litigation counsel in the U.S. attorney's office, said police have passed out 17,000 hand bills detailing the program. There are Exile billboards, television spots and even a giant black city bus that runs through the city with a message in stark, white paint: "An illegal gun gets you five years in federal prison."

A coalition of civic and merchant groups has raised $40,000 and pledged an additional $60,000 to fund the marketing efforts.

Though the Exile prosecutions have not been glamorous -- "These cases are not sexy: These are mutts with guns," said Schiller -- they are getting notice in other urban centers. Seventeen cities nationwide, including the District and Baltimore, are now participating in a federal pilot program to trace illegal guns, and there has been talk of extending Exile elsewhere.

"Richmond has one of the most involved programs in the country," said Joe Sudbay, a spokesman for Handgun Control in Washington. "It's a great combining of resources to combat violence."

NRA Executive Director Wayne R. LaPierre said that Exile "ought to be in every major city in the country where there's a major crime problem.

"The dirty little secret is that there is no enforcement of federal gun laws," LaPierre said. "What Exile's doing -- which I think is great -- is for the first time in a major American city, if a criminal picks up a gun, he'll do major time. It's a message the NRA cheers, a message police cheer.

"That's the magic of what they're doing in Richmond. The word is out on the streets of Richmond that the U.S. attorney is dead serious about stopping gun violence."