Founded in Berkeley, California, Amoeba Music has established itself as one of America's most iconic music store chains. With three locations across the state, co-founder David Prinz says its Los Angeles store alone brings in $20 million in annual revenue.

It's original location on Telegraph Avenue, however, has seen revenues plummet by 50 percent over the past decade. Thanks to the initial rise of pirating services like Napster and LimeWire, and then legal streaming services like Spotify, students in the local area stopped buying records and CDs.

But financial trouble is not unique to Amoeba; Telegraph Avenue is blighted and its local economy has been in decline for years. Since the 1990s, sales at stores along Telegraph have dropped over 40 percent, Dave Fogarty, Berkeley economic development project coordinator, told San Francisco Chronicle in 2013. Prinz, who started Amoeba with Marc Weinstein in 1990, said they needed to create a new revenue stream to prevent the Berkeley shop from closing. It's rescuer? Medical marijuana.

Four and a half years ago, as the medical marijuana business started to show its muscles in California, Prinz and Weinstein decided to convert its once-popular 3,000 square foot jazz room into a marijuana dispensary. After submitting an application last fall, the founders finally received approval last week from the city of Berkeley for a license to sell medical marijuana. Prinz says the dispensary, which will be a totally separate space with its own entrance, will open by May 2017. "Marijuana will save Amoeba Music in Berkeley," says Prinz.

This isn't Amoeba's first foray in marijuana. Since April 2014, its San Francisco location has been running a medical marijuana recommendation clinic with Dr. Samuel Dismond. The clinic, which does not sell marijuana, sees about 50 patients a day who consult with the doctor and leave with a recommendation to use cannabis.

"The clinic helps us continue to pay the rent and helps us pay our employees," Prinz said. "But the dispensary is going to be more lucrative."

The Berkeley location will sell marijuana and THC-infused products. Because Prinz and Weinstein have never sold marijuana before, they partnered with longtime advocate and marijuana entrepreneur Debby Goldsberry. She's also a founder of Berkeley Patients Group, a respected cannabis supplier and dispensary operating since 1999. (BPG is seen as a model for the industry--it pays millions in taxes, follows rules and regulations, and donates to the poor.)

"I don't think we could've kept Amoeba Berkeley going without this. Our store in Berkeley took the biggest hit; college kids are the first to find out how to get music for free," says Prinz. "I think we'll see the college kids come back again once the dispensary opens."

Prinz says they invested about $500,000 in total for the license, and to keep the store open. The dispensary will not grow its own marijuana, but instead purchase the cannabis from farmers in Northern California. He says he's been flooded by interest from growers who want to help stock Amoeba's shelves with weed.

"Twenty years ago, Rolling Stone said we built the best record store," says Prinz. "We think we'll be able to do that for this industry--my goal is to build the best dispensary in the world." He hopes to bring the "Amoeba experience" to the dispensary, which will be called the Berkeley Compassionate Care Center. (If the shop ever becomes recreational, Prinz says they will call it "AmoeBuds.")

The impetus for the dispensary was to save the business, but Prinz and Weinstein say there was another motivating factor: Rasputin Music has been on Telegraph Avenue since 1971, decades before Amoeba Music moved in across the street. Founded by Ken Sarachan, Rasputin watched record store after record store bite the dust.

To honor the fallen record shops, the store made a tote bag with a cemetery illustration, featuring tombstones with the names of every record stores that went out of business in the area: Tower Records, Sam Goody, Odyssey Record, Music Land, Peach's, Moby Disc, Rough Trade, Rainbow Records, Star Records, Aron's, and more.

"I care about Berkeley, I care about Telegraph, I care about the kids, the patients, but we will not end up on that bag," said Prinz, half joking. "I paid over half a million dollars so we don't end up on that bag."

Rasputin and Amoeba have been locked in an epic feud for 26 years--ever since Weinstein quit working at Rasputin and opened up shop across the street. "We are fighting to keep our store open, we are fighting to keep our employees' jobs," says Prinz. "We think marijuana will help us continue the fight."