OLYMPIA, WASH. — Three weeks before voters in the state of Washington will cast ballots over an initiative requiring labeling of bioengineered foods, the state’s attorney general has filed a suit alleging the Grocery Manufactures Association broke the state’s campaign disclosure laws.

Bob Ferguson, the attorney general, alleged the G.M.A. raised, collected and spent more than $7 million in the campaign over Initiative 522 while shielding the identities of the effort’s contributors. The G.M.A. opposes mandatory labeling of bioengineered foods.

“Truly fair elections demand all sides follow the rules by disclosing who their donors are and how much they are spending to advocate their views,” Mr. Ferguson said.

In an official statement Oct. 16, the G.M.A. said it “takes great care to understand and comply with all state election and campaign finance laws.”

In the allegations, Mr. Ferguson said the G.M.A. established a “Defense of Brands Strategic Account” in its organization and solicited members for contributions to be used to oppose I-522.

Mr. Ferguson said the G.M.A. should have formed a separate political committee, registered with the state’s Public Disclosure Commission, and filed reports indicating who contributed, how much they contributed and how the money was spent to oppose I-522.  In the lawsuit filed in Thurston County Superior Court, the attorney general sought to compel the G.M.A. to register with the Public Disclosure Commission and to file disclosure statements.

Two days later the group said it would increase its disclosure in connection with its campaign.

“In the spirit of continuing cooperation and in an effort to provide Washington voters with full transparency about G.M.A.’s funding for the ‘No on 522’ campaign, the association has voluntarily decided to establish a Washington State political committee and to file reports with the Public Disclosure Commission disclosing the source of all funds used in connection with Washington State elections.

“G.M.A. is taking this action to allow the campaign to focus on the important issues related to the I-522 ballot proposal itself, and to put an end to unnecessary distraction and speculation about sources and amounts of funding.

“G.M.A. has cooperated fully with the Public Disclosure Commission and the Attorney General throughout their investigation, and will continue to engage state authorities in a constructive dialogue in the weeks and months ahead.”

Polls in the state of Washington in June indicated 66% support for mandatory labeling.

According to a ballot summary, the measure would “require foods produced entirely or partly with genetic engineering, as defined, to be labeled as genetically engineered when offered for retail sale in Washington, beginning in July 2015. The labeling requirement would apply generally to raw agricultural commodities, processed foods, and seeds and seed stock, with some exceptions, but would not require that specific genetically-engineered ingredients be identified. The measure would authorize state enforcement and civil penalties, and allow private enforcement actions.”

In recent weeks, debate over the initiative has centered on the costs of implementation. Advocates of mandatory labeling contend “it would not cost a dime” while opponents have said the regulatory costs of implementation of monitoring compliance would cost a typical family of four at least $450 per year.