The ruling by Superior Court Judge Loretta Giorgi confirmed a tentative decision she issued a day earlier and came after she heard arguments from proponents of the ban.
Michael Kinane, an attorney for the proponents, told Giorgi circumcision was not a medical procedure. He also said the ballot measure included an exception in cases where circumcision was needed for health reasons.
Giorgi was not swayed and ordered San Francisco's elections director to remove the measure from the ballot. San Francisco would have been the first city in the nation to hold a public vote on whether to outlaw the circumcision of minors.
The citizens' initiative, which made the ballot in May, would have made the practice a misdemeanor punishable by a fine of up to $1,000 or up to one year in jail.
The initiative did not offer exemptions for religious rituals such as the Jewish bris or Muslim khitan.
The city attorney's office had joined several Jewish organizations in challenging the ban in court.
Backers had argued the ban was necessary to prevent a form of genital mutilation from being forced on children. Kinane pointed out Thursday that the federal government bans female circumcision.
Critics contended the initiative posed a threat to constitutionally protected religious freedoms and cited comic books and trading cards distributed by the measure's proponents that carried images of a blonde, blue-eyed superhero and four evil Jewish characters.