A group of community and labor organizations is accusing Walmart of inappropriately using the nonprofit Walmart Foundation to help reduce local opposition to its expansion efforts in some urban areas like Washington, Boston, Los Angeles and New York.

The group argued in a complaint with the Internal Revenue Service dated Monday that the Walmart Foundation violated terms of its tax-exempt status by targeting millions of dollars in donations that would directly benefit the retailer.

The Walmart Foundation’s contributions in some cities rose steadily as Walmart tried to curry local support and gain access in those markets, according to the complaint. The foundation donated just over $200,000 to organizations in Los Angeles in 2008 and 2009, the complaint said, but raised that amount to $1.4 million in 2011, just as plans to open a store were getting underway. In 2013, the year that store opened, donations dropped to about $230,000.

“I think if this is truly charitable donations, they would be giving this every year,” said Matt Ryan, the executive director of the nonprofit advocacy group Alliance for a Greater New York, which signed the complaint. “I would characterize it as part of a smoke-and-mirrors campaign that Walmart would run when they’re trying to move into a city.”