The ban is for one year, but the council can extend it for another year.
But state or local laws have no effect on federal activities.
Although voters in California approved the use of medical marijuana in 1996 and said users should not be subject to criminal prosecution, it remains illegal under federal law to possess, sell or cultivate marijuana and neither the federal nor state courts have resolved the matter.
Drug Enforcement Administration officers served a search warrant on facilities across Los Angeles County, including the California Patients Group in Hollywood, said DEA spokeswoman Sarah Pullen. The timing of the raid was not intended to coincide with the council vote, she said.
"These are ongoing enforcement operations. As far as we know, we've been planning this for some time," Pullen said.
The Los Angeles Police Department was on hand to patrol the perimeter, as it often does as a courtesy to federal agencies.
LAPD officers arrested five people demonstrating outside the California Patients Group dispensary, Lt. Ruben De La Torre said. Four of the arrests were for blocking a DEA vehicle and failing to comply with orders from a police officer to move. The other arrest was for vandalizing a police car.
Don Duncan, operator of the Hollywood dispensary, was the first activist to testify at Wednesday's council meeting. He also is a board member of Americans for Safe Access, a pro-medical marijuana group.
"It's disgusting that sick people would be subjected to this right here in Los Angeles," Duncan said.
Pullen said that although medical marijuana was legalized by state voters, the DEA has been enforcing federal laws. The agency has ramped up efforts recently because the number of dispensaries has grown to more than 400 in Los Angeles County and the surrounding area, she said.
The DEA and other agencies earlier this month issued indictments against six men, alleging that they participated in selling marijuana at dispensaries throughout the state, including two such stores in West Hollywood.
In response to a request from the council, the office of City Atty. Rocky Delgadillo reported earlier this year that at least 98 dispensaries are in Los Angeles, although some activists believe there are more.
The report also found that 12 dispensaries were near schools or day-care centers.
City Councilman Dennis Zine said the temporary ban was designed to protect patients' rights while drawing up rules to protect communities where dispensaries are located.
Several dozen medical marijuana activists attended the council meeting to support the temporary ban. No one spoke against it.
Activist Sarah Armstrong said that she often has to travel from her home in Ventura County to Los Angeles to obtain medical marijuana to help relieve pain from arthritis she said was the result of a 1989 car crash.
Cities and police agencies in Ventura County and others in Southern California have been far less tolerant of the dispensaries, which is why most in the region are in L.A. County.