The chief outside counsel to President Bush's campaign resigned yesterday after acknowledging he had provided legal advice to a veterans group that has run television ads attacking Democratic nominee John F. Kerry. The resignation touched off angry exchanges between Bush and Kerry advisers over links between their campaigns and outside groups working to influence the election.

Benjamin L. Ginsberg, former general counsel to the Republican National Committee and a lead attorney for Bush in the Florida recount battle of 2000, defended his representation of Swift Boat Veterans for Truth as "fully appropriate and legal" and similar to activities of Democratic lawyers or law firms working with Kerry or the Democratic National Committee and "527" organizations such as MoveOn.org.

"Unfortunately, this campaign has seen a stunning double standard emerge between the media's focus on the activities of 527s aligned with John Kerry and those opposed to him," Ginsberg, a partner in the law firm Patton Boggs, wrote in a four-paragraph letter to Bush. "I cannot begin to express my sadness that my legal representations have become a distraction from the critical issues at hand in this election . . . so I have decided to resign as national counsel to your campaign to ensure that the giving of legal advice . . . doesn't distract from the real issues upon which you and the country should be focusing."

The volley of charges and countercharges opened up a new window on the activities of the controversial 527 organizations, named for the section of the tax code that governs them. They have become prominent in the wake of the new campaign finance law and have played a significant role in the campaign. Democrats have made far more use of the organizations, which have spent tens of millions of dollars in ads attacking Bush, but Republicans have moved recently to establish their own and have begun to put significant amounts of money into them.

Bush campaign officials charged that Kerry's campaign has been advised by lawyer Robert F. Bauer, who also represents several of the Democrats' biggest 527 organizations, and said that DNC counsel Joseph E. Sandler also acts as the attorney for MoveOn.org. Bush campaign manager Ken Mehlman said the media has tolerated "blatant lies" by the Kerry campaign about the activities of Democratic lawyers.

Kerry officials said Bauer is not the campaign counsel, but Bush officials pointed out that his biography on the Perkins Coie law firm's Web site lists him as national counsel to Kerry-Edwards 2004 Inc. Bauer said that title refers to his work on voter-protection issues, which initially were performed through the campaign but are now coordinated at the DNC.

Bauer's partner, Marc Erik Elias, serves as general counsel to the Kerry-Edwards campaign. Kerry and DNC officials said that dual roles by lawyers are legal and that none of them would be severed from their positions because of Ginsberg's resignation. They accused the Bush campaign of trying to divert attention from what they said was the real issue -- what they labeled scurrilous and inaccurate personal attacks aimed at Kerry.

The resignation came amid a growing political battle over the allegations by the Swift boat veterans about Kerry's combat record as a naval officer in Vietnam and his antiwar activities in the early 1970s. Those charges have been aired in ads running in only a few battleground states, but they have dominated coverage of the presidential campaign for the past 10 days. Many of the charges have been undermined by the testimony of other veterans who served with Kerry in Vietnam or by military records.

Kerry's campaign, after initially ignoring the charges, has mounted a fierce counterattack in the past week, charging that the Swift boat ad campaign was orchestrated by the Bush campaign and calling on the president to denounce the ads directly, which he has declined to do. Kerry officials seized on Ginsberg's resignation as evidence of collusion between the anti-Kerry veterans and the Bush team, and said it calls into question statements from Bush advisers that the campaign has no connection with the ads of outside groups.

"Now we know why George Bush refuses to specifically condemn these false ads," Kerry campaign manager Mary Beth Cahill said in a statement. "People deeply involved in his own campaign are behind them, from paying for them, to appearing in them, to providing legal advice, to coordinating a negative strategy to divert the public away from issues like jobs, health care and the mess in Iraq, the real concerns of the American people."

That charge drew a quick rebuttal from Ginsberg and Bush campaign officials, who said there is no coordination between the campaign and the anti-Kerry veterans. "No one in the Bush campaign has coordinated with the Swift boat veterans," White House senior adviser Karl Rove told Fox News.

Ginsberg, in a telephone interview, said he told no one at the Bush-Cheney campaign or the White House about his representation of the Swift boat group until Tuesday, with the exception of the campaign's chief counsel, Thomas J. Josefiak. He said he had a lawyer-to-lawyer discussion a few weeks ago with Josefiak about the appropriateness of providing legal advice to 527 organizations and the campaign.

Robert Franke, an official in the Swift boat veterans group who sought Ginsberg's legal advice sometime in July, also denied any coordination with campaign officials or with Ginsberg directly. "I've never talked to him at all about content of the ads or timing of the ads," Franke said in a telephone interview.

Ginsberg's resignation was the second departure from the Bush campaign by someone with ties to the Swift Boat Veterans for Truth. Over the weekend, retired Air Force Col. Kenneth Cordier, a campaign volunteer, was removed from the Bush campaign's veterans steering committee after appearing in a Swift boat ad.

Democrats also pointed to the involvement in the Swift boat group of Bob Perry, a Houston lawyer and major GOP donor in Texas, who has donated $200,000 to the organization, saying his role showed a connection between the Bush team and the veterans opposing Kerry. Rove called Perry a longtime friend but again denied any connection between Perry's activities and the president's campaign.

"He's a good friend of mine," Rove told Fox News. "I don't want to leave any misimpression. But he's not somebody that I've had, you know, any extended conversation with in years and certainly did not discuss with him or anybody else in the Swift boat leadership what they're doing."

Ginsberg's resignation infuriated conservatives and Republicans, who charged that equally questionable relationships exist between the Kerry campaign and a network of pro-Democratic independent groups.

The Bush-Cheney '04 organization issued a news release citing numerous instances of key figures, other than Bauer and Sandler, who have been involved with the Kerry campaign, the Democratic Party and the independent groups, including:

* Harold Ickes, a DNC executive board member, who founded the Media Fund, which has spent more than $25 million on anti-Bush television ads.

* Former Kerry campaign manager Jim Jordan, who is now chief spokesman for America Coming Together and the Media Fund.

* Zack Exley, who left MoveOn.org -- which has spent millions on anti-Bush ads -- to become online communications director for the Kerry campaign.

* Bill Knapp, who produced television commercials for the Media Fund, and has been hired as a media consultant by the Kerry campaign.

"Ben's resignation is an example of a decent public servant who understood the entrenched double standard in the media's examination of the relationship between campaigns and outside interest groups," Mehlman said.

The controversy over the role of the 527 groups has been brewing since mid-2002, when Democratic and GOP strategists began exploring ways to get around the new McCain-Feingold law's ban on unlimited "soft money" contributions from corporations, unions and the wealthy to the political parties.

Both sides created networks of 527s, but Democrats were initially much more successful. They raised money from rich liberals and labor unions while the GOP effort faltered, in part because corporations were reluctant to give to organizations facing legal challenges.

The Bush-Cheney committee and the RNC sought to block the Democratic 527s, filing a formal complaint with the Federal Election Commission. On May 13, when the FEC announced that it would not regulate the 527s in the current election cycle, Republicans renewed their efforts to raise money for their 527s and, in recent weeks, have been very successful.

Republicans, who complained for months about the attacks from the Democratic 527s, have begun to respond with negative ads. The Swift boat group has spent about $1.2 million on its ads, according to the Kerry campaign, compared with about $60 million spent by Democratic 527s. But with that small investment, the anti-Kerry group has been able to dominate the campaign debate for the past two weeks.

Another group, which Ginsberg also represents, has raised at least $14 million. Officials of Progress for America Voter Fund said that among the major donors to the group are two Californians, Alex Spanos and Dawn Arnall, both major fundraisers for the Bush campaign and the RNC. Each has given $5 million to the new group.

Benjamin L. Ginsberg, Bush-Cheney outside counsel, also advised a group of Swift boat veterans attacking John F. Kerry on TV.