NEW YORK  After years of squabbling over how to move mountains of trash out of New York, the city has dumped its system of trucks and approved a plan to ship it away on barges.

Mayor Michael Bloomberg had long campaigned to use the waterways instead of the fleet of trucks that groan and zigzag through the streets on their way to landfills outside city limits. He said it will reduce pollution from truck exhaust and help thin traffic congestion.

But overhauling the trash plan has been a complicated process. First consider the amount of refuse produced in New York, a city of 8.1 million people. While many American cities get by with weekly neighborhood trash collections, the garbage piles up so high in New York that many curbs are cleared three times a week.

And along with all that garbage, changing the truck system -- which was supposed to be temporary -- created a pile of political battles and trash talk. There are tales going back years of marathon overnight negotiating sessions, fights breaking out among lawmakers and trash plans that fell apart even after they passed through the City Council.

For decades, the city carted its refuse to a landfill on Staten Island, which residents there despised. The landfill was closed in 2001 under a deal reached by then-Mayor Rudolph Giuliani, and when Bloomberg entered City Hall in 2002 he inherited the truck solution.

He first raised the barge idea that year, and ever since various City Council members, community groups and residents had protested aspects of the scheme that would affect their neighborhoods.

Citizens on the Upper East Side, a wealthy swath of Manhattan, complained that a trash transfer station along the East River there would stink up a park where children play, while those in another area on the West Side weren't thrilled about a giant recycling station in their backyard. There were accusations of "environmental racism" from those who said some New Yorkers would rather sweep the mess out of their sight and into poor and minority areas.

But the City Council and the Bloomberg administration finally hammered out a proposal that pleased enough lawmakers for a majority vote in the council late Wednesday, though not without hours of discussion and debate, most focused on the Upper East Side station.

"I do not believe it is good or enlightened public policy to put a garbage station in the heart of a residential community -- under any circumstances, anywhere in New York City," said Councilman Daniel Garodnick.

The mayor was expected to sign off on the plan, which could take years to implement. There are elements that need state action and a few legal challenges that could delay the start.

Once the new system is place, the trash picked up curbside will be taken to waterfront transfer stations -- two in Brooklyn, one in Queens and one on Manhattan's Upper East Side. Two additional Manhattan locations will handle some commercial waste and recycling.

From the marine stations, barges will take the garbage to secondary transfer terminals, where it will be moved by rail or oceangoing barges to out-of-state landfills.

The approved plan, hailed by environmental groups, also establishes a separate office to oversee recycling.