SAN JOSE — In an effort to quash illegal pot delivery services that have mushroomed in recent years, San Jose leaders Tuesday agreed to allow the city’s 16 sanctioned pot shops to deliver marijuana to a patient’s front door.

“The truth is that delivery has been the hardest part of the illegal marketplace to enforce,” said Michelle McGurk, an assistant to the city manager who oversees the medical marijuana policy. “And new illegal deliveries are popping up every day.”

But a heated discussion about when San Jose should explore allowing medical pot distributors, manufacturers and testing labs in the city led to a clash on the City Council and a rare re-vote. After more than an hour of discussion, the council voted 8-3 to explore the issue immediately, with Mayor Sam Liccardo, Vice Mayor Rose Herrera and Councilman Chappie Jones opposing.

Liccardo wanted the idea to go through the council’s “prioritization process” — which allows council members to officially vote on top priorities, assigning a green, yellow or red light to each issue. But critics worried that would delay the discussion since the council won’t go through that process again until January — and there will be four new council members by then.

The decision to explore the policy right away, instead of putting it off to January, was a victory for Councilman Ash Kalra, who urged his colleagues to move quickly in light of the possible legalization of recreational marijuana through Proposition 64.

“How can we possibly say medical marijuana is not a priority?” Kalra said. “To say that it’s not a priority is not consistent with how we’ve acted and doesn’t do us good in terms of being prepared for what the state does.”

The City Council on Tuesday also green-lighted a slew of changes to San Jose’s two-year-old medical marijuana regulations, including allowing each dispensary to grow marijuana at two sites instead of one and allowing one of those locations to be anywhere in California. City leaders also approved allowing San Jose collectives to receive products from around the state and to share cultivation sites.

Medical marijuana advocates applauded the decision Tuesday, saying loosening the city rules allows local collectives to keep up with patient demand and grow a variety of medicine.

“It provides a lot of flexibility for the collectives to be more competitive,” said Jerry Strangis, who represents Caliva on South 7th Street. “If you’re restricted to growing inside a warehouse in San Jose, the costs are much more expensive and you’re constrained.”

But the biggest change is allowing legal deliveries, a move supported by the San Jose Police Department to help cut down on illegal services.

There are 37 illegal pot delivery services in San Jose, police officials said Tuesday, undermining the city’s medical marijuana regulations. The approved changes will allow deliveries from 8 a.m. to midnight and only to patients or caregivers who are 21 or older.