Attorney General Eric Holder said the Obama administration “strongly opposes” a California ballot measure to legalize marijuana, warning that federal drug-enforcement efforts would be “greatly complicated” if the measure passes.

Recent polls indicate voters narrowly favor passing the Regulate, Control and Tax Cannabis Act, also known as Proposition 19, in next month’s election. If passed, the measure would only affect state law, leaving intact the federal law that classifies marijuana as a controlled substance alongside cocaine and other drugs.

Mr. Holder said in a letter Wednesday to nine former Drug Enforcement Administration chiefs that the administration would continue to enforce federal law if California legalizes marijuana. The DEA chiefs had urged him to speak out on the matter.