In October, the city council of Portland, Oregon, in between updating the payroll system for the police honor guard and changing the duties of the golf advisory committee, adopted a resolution banning Walmart—and Walmart alone— from the city’s investment portfolio. The resolution, unanimously approved, cited an anonymous executive who was quoted in Charles Fishman’s 2006 book, “The Wal-Mart Effect,” saying, “They have killed free-market capitalism in America.”

Earlier this month, Portland began to cut Walmart out of its investment portfolio. The first of the city’s five Walmart bonds reached maturity and will not be replaced. Portland’s Walmart holdings had represented about three per cent of its portfolio of roughly one billion dollars. In 2016, when the last bond matures, the city council will be rid of Walmart investments entirely.

Portland is the first major U.S. city to formally divest from the retailer, but in Europe institutional investors have been rejecting Walmart for years. Last year, two large Dutch pension funds said that they would no longer invest in Walmart because of its labor practices, especially its fierce opposition to unions. The fund managers also raised concerns about Walmart’s alleged bribery of Mexican officials—a scandal that the company has spent more than four hundred million dollars investigating. Sweden’s pension funds sold their Walmart bonds last fall, and, in 2006, Norway’s Ministry of Finance excluded Walmart from its pension fund, citing alleged human-rights and labor violations.

Divestment campaigns typically have specific pressure points; the best-known effort, in the nineteen-seventies and eighties, was aimed at getting companies to withdraw from South Africa to oppose apartheid. The effects of such campaigns are hard to measure. A 1999 study of the anti-apartheid movement found that the divestment campaign did little harm to the target companies’ stock prices. But if it reinforced the public revulsion to apartheid, the authors suggest, it may have hastened the end of the regime in other ways. In the past few years, students have exhorted universities to divest from companies that profit from coal and other fossil fuels.

In Portland, the city council expressed a diffuse constellation of grievances. Walmart “exerts considerable downward pressure on wages”; it “significantly reduced health insurance benefits for part-time employees” by changing eligibility standards; it “has focused on fast, low-cost production at the expense of basic safety measures for employees.” It isn’t clear what, if anything, the retailer could do to regain favor. Commissioner Steve Novick, who led the push for the do-not-buy list, wrote in a blog post, “You have to start somewhere—and we might as well start with a company that is openly, notoriously and extravagantly bad to the bone.” Others in the city’s investment portfolio might be next, he warned: “General Electric is a poster child for tax evasion. Coca-Cola is practically in the business of increasing the incidence of diabetes.”

Walmart has always been an uneasy fit for the bike-commuting, kitchen-composting, backyard-chicken-raising denizens of Portland. A former mayor, Sam Adams, vociferously opposed Walmart’s expansion in Portland during his tenure as a city commissioner, even hanging a sign from his office window in which the retailer’s smiley-face logo had been recast with a frowning expression and angry eyebrows. But as mayor Adams didn’t try to block a Walmart supercenter that opened in Portland last year, and Charlie Hales, the current mayor, didn’t appear at Novick’s press conference. Residents’ opposition to new Walmarts also seems more muted than it used to be.

Portland isn’t trying to kick out the two Walmart supercenters within city limits, which together employ about five hundred and fifty people, or halt construction on the two suburban supercenters that the retailer plans to open later this year—and for which it will hire another six hundred workers. (In the suburbs, Walmart has five more supercenters and eight “neighborhood markets,” smaller stores that primarily sell groceries.) “Portland is a food city, with the legendary food carts, numerous farmers markets and community gardens,” Walmart posted on its Web site about its business in Oregon. “For families that are unable to access these avocations, Walmart offers many options at affordable prices.”

Living with Walmart is complex—sort of like living with an assertive, charismatic, and powerful family member. Research from Jerry Hausman, an economist at M.I.T., shows that, when Walmart enters a new market, it drives down grocery prices in general; to compete with Walmart’s low prices, other stores lower their own prices. Low-income families benefit most, because they spend a greater proportion of their wages on food. But Walmart’s presence can also hurt those same families, because it tends to reduce over-all retail employment—perhaps by driving out smaller stores, which typically employ more workers per dollar of sales. On the one hand, Walmart helps the city, county, and state budgets; it pays various taxes, and its employees pay income tax. (Oregon has no sales tax.) On the other hand, as the nation’s largest private employer, and one that offers mostly low-wage jobs, its workers are prime beneficiaries of food stamps and Medicaid, funded by taxpayer dollars.

It gets more complicated. In Portland, Walmart’s store in the Delta Park neighborhood, which opened last year, houses the city’s largest green roof—forty thousand square feet of vegetation and sediment, which helps to cool the store, reduce storm-water runoff, and convert carbon monoxide to oxygen. Students and faculty at Portland State University’s Green Building Research Laboratory will study the building for the next two years. Jonathan Fink, the university’s vice-president for research and strategic partnerships, said that the research “will contribute to better, more sustainable buildings around the world.”

Two years ago, @WalmartLabs, a technology division of the retailer, purchased Small Society, a highly regarded mobile developer based in Portland that had created apps for Starbucks, Whole Foods, and Zipcar—companies whose culture better matches Portland’s ethos. One of Small Society’s founders had even developed an iPhone app for Obama’s 2008 campaign. Some residents accused Small Society of selling out; after all, even its name seemed opposed to Walmart’s values. Others were pleased that a homegrown business had attracted the attention of a global company. After purchasing Small Society, @WalmartLabs leased nearly nine thousand square feet in downtown Portland and more than doubled the staff.

Last year, Walmart donated nearly five million pounds of food to Oregon’s food banks—enough for more than four million meals. In addition, Walmart and its foundation gave nine and a half million dollars to the state in charitable donations, including thirty-five thousand dollars to Our House of Portland, which used the money to provide nearly three thousand food boxes to people living with H.I.V. and AIDS. Walmart gave nearly twenty-nine thousand dollars to the Portland Rescue Mission, to expand services for homeless men, women, and children, and nearly sixty-three thousand dollars to Portland Adventist Community Services, to pay for a new van for meal delivery and food distribution. Opponents argue that if Walmart didn’t exist over-all wages would be higher, so residents wouldn’t need so many services geared toward low-income people. That’s hard to quantify. Walmart hardly has a huge presence in Oregon, and yet poverty and other ills persist.