TRENTON, N.J., MARCH 15 -- Republican legislators here failed today in their attempt to repeal New Jersey's ban on assault-style weapons, the toughest law of its kind in the country.

In a dramatic conclusion to a political battle that has consumed New Jersey politics for six months, the state Senate voted 26 to 0 to retain New Jersey's three-year-old measure prohibiting purchase and ownership of military-style semiautomatic rifles and handguns.

The vote is a crucial defeat for the National Rifle Association (NRA), which has waged a costly, three-year battle against the ban and only a week ago appeared to have the necessary Senate votes to win the day. But following an intensive statewide campaign by Gov. Jim Florio (D) and what gun-control advocates described as an extraordinary wave of public support for the measure, several key legislators in the Republican-controlled Senate defected to the side favoring the ban.

"The people have weighed in and expressed their view that the last thing this state needs is greater access to military-style weapons," Florio said at a news conference following the vote. "The message is that the real people -- not special interests or the gun lobby -- want more attention to be paid to public safety."

Florio said he believes the vote will provide an impetus for passage of gun-control legislation in Congress.

But the vote, while decisive, does not appear to have settled the issue of assault weapons in New Jersey. Representatives of both the NRA and its state affiliate, the Coalition of New Jersey Sportsmen, vowed to carry the fight to November's gubernatorial election and to target those Republican lawmakers who abandoned the fight against the ban.

"We've done nothing wrong except to be a bad judge of character," said the coalition's legislative director, Rodger Iverson, who vowed to raise $100 from every one of his group's members. He said the money will be used to unseat those senators who "betrayed" him.

"We're in this forever because we're fighting for freedom," he said. "You don't quit on freedom."

The assault ban issue surfaced in New Jersey in May 1990, when the newly elected Florio -- in concert with the then-Democratic-controlled state Senate and General Assembly -- made it illegal for residents to buy any of several dozen semiautomatic rifles and handguns capable of firing more than 15 rounds of ammunition at one time. The bill also said that if any resident already owned one of the guns on the list, the owner had one year either to sell it out of state, disable it by removing the firing pin or surrender it to police. According to the NRA, there are more than 300,000 assault-style weapons owned by New Jersey residents.

The gun lobby first fought the law in the courts, arguing that it was unconstitutional for the state to confiscate weapons purchased by gun owners without granting compensation. In June 1991, a state appellate court rejected that argument.

Then in November 1991, the Republicans regained control of the Assembly and Senate, following a campaign in which the NRA and the coalition contributed $364,000 to the campaigns of anti-gun-control legislators. In August 1992, the Legislature passed a new law that all but repealed the initial gun ban. Florio immediately vetoed the bill.

Today's vote was an attempt by the Republican leadership in the Senate to override Florio's veto. Three weeks ago, the Assembly had done just that, setting the stage for a possible defeat to Florio's political agenda.

But following a week of intensive lobbying, the original Republican majority slipped. In today's vote, 26 senators voted to sustain the veto, 12 abstained and two were absent. Fifteen Republican senators who had originally voted for the bill gutting the gun ban changed their minds.

"The NRA was its own worst enemy," said Jack Johnson, chairman of New Jersey Citizens to Stop Gun Violence. "They have a way that intimidates. They put a significant amount of money into fighting this ban. But I think in the end it backfired."

With the legislative battle now out of the way, Florio and state officials still face an equally daunting obstacle -- ensuring compliance with the ban itself. Although it has been illegal in the state to own an assault-style weapon, almost none has been voluntarily handed in by the state's citizens and only 2,000 of the estimated 300,000 in private ownership have been reclaimed by police.