Eddie Gray and his longtime companion, Cleopatra Cooper-Williams, make about $500 a month hauling garbage bags full of cans and bottles to the Alliance Metals recycling center on Peralta Street in West Oakland.

“This is our livelihood,” said Gray, a sinewy 76-year-old retiree who uses his recycling earnings to help pay rent and bills for the couple’s North Oakland apartment, supplementing the income he receives from Social Security.

Gray and Cooper-Williams will have to come up with an alternative plan by Saturday. After a decades-long war with exasperated neighbors and city officials who have charged the center with numerous nuisance violations — from allowing shopping carts to block the street to buying plundered metals — Alliance has agreed to shut its doors on Aug. 20. In exchange, the city will forgive almost $18,000 in fines imposed on the company since May of last year.

“If the city and the neighborhood think they have problems now, (they) are in for a rude awakening,” said Lance Finkel, who bought Alliance with a business partner in 2013 and renamed it Glass King — though it is still identified in city documents as Alliance Metals.

Finkel said he will abide by the terms of the agreement and close up shop. Even so, he had a warning for the city: “Trash is going to be worse. There’s going to be stealing and maybe rioting.”

But residents who live nearby say the company, which opened in the mid-1980s, has long wreaked devastation on the neighborhood by providing income for drug addicts who for years have congregated on a small greenway across the street.

“Drug addicts come to Alliance, they get their money, and they go straight to the dealers,” said Silva Harr, a neighbor who has lived in West Oakland’s Dogtown neighborhood since 1978. She said recyclers steal anything that’s not nailed down — construction equipment, car radios, even gardening tools — and that they often sneak into her side yard to relieve themselves.

“When we’re cleaning up around there, we’ll frequently notice human excrement,” Harr said.

Alliance’s battles with the neighborhood began in the 1980s and heated up in 1995 after the company obtained a conditional use permit to double the size of its site at Peralta and 34rd streets. Its owners took over a church that had been next door and bought the congregation a new building on 34th Street. The recycling center bought a bailer and a huge compression machine and became a neighborhood fixture, drawing recyclers who clattered their shopping carts down Peralta Street day and night.

Around that time, the once semi-industrial neighborhood became increasingly residential, and a new population of middle-class families and professionals began moving into the area.

“We had gentrification, and the neighbors would file complaints that (the center) was a nuisance, and we’d appear before the Planning Commission repeatedly,” said Rena Rickles, the attorney who has represented Alliance since 1998.

Alliance’s owners characterize their company as a community benefactor, providing a modest income to a growing population of down-and-out people who lack other economic opportunities. Critics say it’s a business that makes money off the backs of poor people and even encourages theft: In 2009, Oakland police did an undercover operation in which officers, posing as thieves, successfully sold what they said was a stolen piece of copper to a company employee.

The amounts the company pays — $1.57 a pound for cans, $1.19 a pound for plastic, and 10 cents a pound for glass — are just enough to buy drugs in the park across the street, some neighbors say.

“It’s very hard to roommate with a business that says it can’t control the behavior of its clientele,” said Dogtown resident Carol Wyatt. “If the clients are opening drug markets and shooting heroin in an area where children go, that’s a problem.”

Yet some people who hock scrap at Alliance say the business has helped them pay for food, housing or school supplies. Sharli Latimore, 56, said money she makes from recycling helped put her three adult children through college. Robbie Smith, who is 63 and homeless, said that recycling income helps pay for food.

In May 2015, the city began fining Alliance, saying recyclers’ shopping carts were obstructing the roadways and that the company was leaving trash in the streets, among other things. Four months and 40 violations later, the two sides cut a deal: Alliance agreed to close down, and Finkel said he would move all his West Oakland business to another recycling center he owns near Jack London Square. If the center remains open after Saturday, it will be fined $1,000 a day.

But as the end draws near, the fight continues. Last year, independent filmmaker Amir Soltani released the documentary “Dogtown Redemption,” which turned the recyclers into a cause celebre.

Soltani accuses city officials and Dogtown residents of putting out two narratives to defame Alliance and its clientele. One, the “slave narrative,” portrays the company as a “plantation” making money off the poor. The other, the “thief/drug addict narrative,” paints the company as an enabler that supports people’s addictions.

He said both narratives are disingenuous — that, in reality, Alliance is a business that provides a modest but critical income for people who are “working hard not to beg.”

“The city absolved itself by shifting the burden of poverty onto a business,” Soltani said. “And the neighbors did the same.”

Despite their frustrations with the company, city officials expressed empathy toward the people who sell their wares to Alliance. Representatives for City Council President Lynette Gibson McElhaney said they meet regularly with neighbors, homeless support teams and Pastor Raymond Lankford of Voices of Hope Community Church, who is trying to find other sources of income for the recyclers. Wyatt said she and other neighbors are happy to provide odd jobs, like stripping paint from houses.

Finkel said he’s eyeing another property at nearby 26th and Wood streets that he says is in a more secluded industrial area. He wants the city to rezone it to open a new recycling center.

But Rachel Flynn, head of Oakland’s Planning and Building Department, said it might behoove Alliance to move farther from West Oakland’s residential pockets — to land where noise, trucks and other annoyances “are not such a big issue.”

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com

Twitter: @rachelswan