OAKLAND, Calif. — As the stubborn economic downturn has forced this city to take painful steps to balance its budget in recent years, it has increasingly turned to one of its newer industries to raise much-needed revenues: medical marijuana dispensaries.

The city has raised taxes on marijuana dispensaries several times in the past few years, and last year it collected $1.4 million in taxes from them — nearly 3 percent of all the business taxes it collected. Now Oakland plans to double the number of dispensaries it licenses, to eight from the current four, in the hopes that it can collect even more revenue.

“This is general fund revenue — it all goes into the melting pot,” said David McPherson, the city’s tax and revenue administrator. “When you’re making decisions about what to continue keeping or not, it goes into that decision process. If you don’t have that money, then you’re making other decisions about ‘Are we going to close the libraries on Monday?’ ‘Are you going to end up cutting a cop?’ ‘Are you not giving funds to our arts and things that help our kids?’ ”

Sometimes lost in the discussion of medical marijuana is the extent to which it has become a small but growing source of new tax collections for cities and states that have been struggling to balance their budgets for more than four years now.