Three months ago, it appeared that the National Rifle Association had reached agreement with members of Congress, police groups and the Reagan administration on legislation to ban armor-piercing bullets.

After weeks of political maneuvering, however, that apparent accord has collapsed amid charges of double-dealing and bad faith, leaving the powerful NRA denouncing the principal House measure as a thinly veiled attempt at gun control.

That bill, sponsored by Rep. Mario Biaggi (D-N.Y.), a former New York City policeman, would ban the manufacture, importation and sale of "cop-killer" bullets, which can easily pierce bulletproof vests. The measure, cosponsored by Rep. William J. Hughes (D-N.J.), has cleared the House Judiciary Committee and is headed for the House floor in the next few days.

But Rep. Jack Brooks (D-Tex.), backed by the NRA, plans to offer an administration bill, a weaker version of the Biaggi measure, as a substitute on the floor.

All sides in the dispute say they support a worthy goal: protecting the police from bullets made of several hard alloys. But their agreement ends there.

An NRA letter sent to members of Congress says that the Biaggi measure "is in fact a gun control bill" that "could end up outlawing almost all conventional ammunition." The NRA, which has contributed nearly $1 million to congressional candidates since 1981, says the bill has the "potential to threaten the law-abiding gun owner and sportsman."

Edward T. Stevenson, a deputy assistant secretary at the Treasury Department, said: "I don't think the Biaggi bill has much of a chance of passing without the support of the gun organizations. You know the power of the NRA."

Biaggi's bill, unlike the administration version, would bar U.S. dealers from selling ammunition defined as armor-piercing. Biaggi said that there are hundreds of thousands of such rounds on the street today, and that armor-piercing bullets were used in the July shooting of 21 people at a McDonald's restaurant in California.

"There isn't any legitimate purpose for these bullets," Biaggi said.

Ira Lechner, counsel for the National Association of Police Organizations, called the Brooks substitute "next to worthless. It's like banning the importing and manufacturing of heroin, but if you happen to have some, you can sell it. It doesn't make any sense to us."

Brooks and NRA officials, however, say a ban on sales would be hard to enforce and unfair to gun dealers. They say there has been little armor-piercing ammunition in circulation since manufacturers voluntarily agreed to make it for sale only to the police and military.

"The people who sell this ammunition may be stuck behind a counter in a Zayre department store someplace," a Brooks aide said. "They are not experts on ammunition."

The Biaggi bill also would give the treasury secretary the authority to ban ammunition that he finds to be "substantially similar in composition" to armor-piercing bullets. NRA officials maintain that all sorts of sporting ammunition, if fired at sufficient velocity, can penetrate a bulletproof vest.

"In our minds, that leaves the door wide open to determining that any ammunition could be armor-piercing," NRA spokesman Jim Baker said. "It also opens the door for an anti-gun administration to outlaw any ammunition."

But advocates say the provision closes a major loophole that would allow firms to circumvent the law with slight alterations in their bullets, and that the government should be able to ban new kinds of armor-piercing bullets.

Craig Floyd, a Biaggi aide, said a hunter would have no use for steel bullets because they pass through an animal, killing it eventually but leaving the hunter empty-handed while the animal flees.

The administration had resisted a bill for two years until last spring, when there was a growing public outcry and Hughes announced he was moving forward with legislation. In June, administration officials summoned a half-dozen police groups to a White House meeting, presented a compromise worked out with the NRA and said the police could take it or leave it.

"The beauty of the bill is we had everyone's support," Treasury's Stevenson said. "We view this bill as being 90 percent of what we want."

Biaggi introduced the White House plan, but the NRA asked Brooks to sponsor an identical measure. "We quite frankly did not trust congressman Biaggi," the NRA's Baker said.

"We were interested in ensuring that policemen were protected, not in trying to tread on the feet of sportsmen and target shooters," the Brooks aide said.

A House Judiciary subcommittee chaired by Hughes, saying the White House plan merely codified the existing agreement with industry, added the controversial provisions to Biaggi's bill last month.

Some police groups, representing sheriffs and police chiefs, have sided with Brooks. Others, like the Fraternal Order of Police, have been counted as supporters by both sides. FOP president Dick Boyd said the group prefers the Biaggi sales ban, but would accept the Brooks bill as a compromise.

The NRA says no police officer has been killed by an armor-piercing bullet. "The whole issue has been misrepresented from its inception in terms of the actual threat to police," Baker said.

But Floyd, disputing this contention, said the NRA is trying to give the appearance of doing something for its thousands of police members.

"The NRA is playing both sides of the issue," the Biaggi aide said. "On one hand, they appease their police constituency by opposing cop-killer bullets. But because their conservative constituency is outraged that they would ever take a position to ban any bullet, the NRA reverses itself and opposes this new version."

Legislation similar to the Brooks bill has more than 90 Senate cosponsors, but faces an uncertain future because Sen. James A. McClure (R-Idaho), an NRA ally, has placed a hold on it and may try to water it down.