THE DECISION BY Wal-Mart to open six stores in the District over five to seven years is estimated to bring 1,800 new jobs to the city, create some 600 construction jobs and generate an estimated $15 million in tax revenue.

Equally important is the fact that long-underserved neighborhoods will have convenient access to affordable groceries and other goods. So the announcement that the mega-retailer has reached a voluntary agreement with the city to provide additional community benefits strikes us as icing on the cake — a win for a city that already was ahead.

Mayor Vincent C. Gray (D) announced Tuesday that the city has signed a Community Partnership Initiative with Wal-Mart that commits the retailer to a range of conditions. These include the contribution of $21 million to local charities, the creation of a workforce development program to focus on low-income and at-risk residents, an effort to use local small and minority-owned businesses for store construction and the payment of $2 million for transportation improvements. The announcement comes less than a week after Wal-Mart revealed plans for two additional D.C. stores, including one sought by the mayor in the Skyland neighborhood of Ward 7.

The agreement represents something of a first for Wal-Mart, which generally is loath to sign formal agreements. Nonetheless, it is not likely to quiet the small chorus of Wal-Mart detractors who had clamored for things like a guaranteed minimum wage of $12.50 an hour and monthly employee transit benefits. Their demands were outlandish: for example, free shuttle transportation to and from the nearest Metro station to each D.C. store every 10 minutes. Wal-Mart was under no legal obligation to pony up anything, nor was it asking anything of the city. No taxpayer money is being used to lure Wal-Mart here, five of the six stores will be built on private land, and the retailer even agreed to forgo a tax exemption given to companies setting up supermarkets in certain underserved areas.

Victor L. Hoskins, deputy mayor for planning and economic development, put it this way: “Normally we incent companies to come here; Wal-Mart is doing the opposite.” Wal-Mart undoubtedly sees business advantages in gaining community support and hopes that a smooth entry into the nation’s capital will ease its expansion into other cities. That doesn’t detract from the credit it deserves in listening to and acting on community concerns or from Mr. Gray’s deft handling to make a good deal even better for the District.