A federal judge ruled unconstitutional yesterday a U.S. law that requires a person to be a member of the National Rifle Association in order to buy surplus government rifles at rates well below their market value.

U.S. District Court Judge Harold H. Greene said that the requirement, enacted by Congress in 1924, violated would-be gun buyers' First Amendment rights to freedom of association and their Fifth Amendment rights to equal protection under the law.

Greene made the ruling in a suit filed by Geoffrey S. Gavett, a Maryland resident, and the National Coalition to Ban Handguns, an umbrella group favoring gun control that frequently lobbies against stands taken by the National Rifle Association.

Gavett sought to buy one of the 600 M-1 rifles the Army put up for sale this year, but was told that he would have to join the NRA first. Gavett refused because he opposes NRA's gun control views. The rifles are sold for $112 apiece although the retail price of the weapons ranges from $250 to $1,000, Greene said in his ruling.

Greene said that "Gavett would obviously not be a better marksman, military draftee, or Army volunteer, if he paid the $15 annually in dues to the NRA, and he is no less capable of being an accurate shooter because he chose not to join the organization. In short, there is no rational basis for the statute."