LOS ANGELES—The California attorney general, Kamala D. Harris, has moved to block a proposed voter initiative that would mandate the execution of sexually active gay men and women, calling it “patently unconstitutional” and a threat to public safety.

Harris said she would ask the state Superior Court in Sacramento to relieve her of having to write the title and summary for the Sodomite Suppression Act, which would clear the way for the author, Matthew G. McLaughlin, a lawyer in Huntington Beach, to begin gathering signatures to get it on the ballot.

The highly unusual announcement by Harris — by all appearances, California law gives no discretion to the attorney general in handling these kind of initiatives — comes as gay groups and others have called on her to block the measure. Harris, who was just elected to a second term, announced this year that she would run for the Senate in 2016.

In her statement, Harris signalled her lack of legal options as she threw the ball to the courts. “If the court does not grant this relief,” she said, “my office will be forced to issue a title and summary for a proposal that seeks to legalize discrimination and vigilantism.”

Even if she is forced to proceed, McLaughlin — who did not return a telephone call seeking comment Wednesday — has a tough road ahead. He would have to gather the signatures of 365,880 registered voters, and it seems highly unlikely that if he succeeded at that, voters in the state would approve a measure like this.

Floyd F. Feeney, a professor of law at the University of California, Davis, said it was highly unlikely that a court would intervene and suggested that this was more of a political gesture than a legal one

“From a purely legal point of view, there is zero point of doing this,” Feeney said. “What we are seeing here is more of the political side of this. She is being pressed by gay-rights activists, she’s wanting to be supportive.”