RICHMOND, Va. (AP) — Local school boards in Virginia have authority to include sexual orientation and gender identity in their anti-discrimination policies, according to the state’s attorney general.

Democrat Mark Herring’s written opinion reverses one issued in 2002 by a Republican predecessor, Jerry Kilgore, who said public schools could not extend such protection without the General Assembly’s explicit permission.

“Every Virginian has the right to live, learn, and work without fear of discrimination,” Herring said in a statement after the opinion was released Wednesday. “Parents should be able to send their kids to school knowing they will be treated equally and will learn in an environment of mutual respect.”

Herring said the state Constitution gives school boards broad supervisory power that allows them to expand their nondiscrimination polices. He also said a state law requires school boards to adopt standards of conduct that ensure an atmosphere “supportive of individual rights.”

Democratic state Sen. Adam Ebbin of Alexandria requested the opinion, which carries weight but is not legally binding.

The Fairfax County School Board requested Kilgore’s opinion in 2002 and declined to enact a sexual orientation nondiscrimination policy after receiving his advice. Last November, the board reversed course and adopted such a policy after Virginia’s same-sex marriage ban was struck down by the federal courts. School officials said that ruling required them to offer the same employment benefits to same-sex and opposite-sex married couples.

A few other school boards had adopted sexual orientation nondiscrimination polices despite Kilgore’s opinion. Herring’s advice clears the way for others.

“School boards across the commonwealth now have the freedom to create and implement inclusive policies that align with the nondiscrimination policies already in place at the majority of Virginia’s leading employers,” said James Parrish, executive director of the gay-rights group Equality Virginia. “Employees should be judged on their qualifications, experience, and the job they do — nothing more and nothing less.”

But Victoria Cobb, president of the Family Foundation of Virginia, said she worries about how such policies will affect conservative students.

“There’s little doubt this policy will be used to silence kids who have deeply held religious beliefs about sexuality,” Cobb said.

She also said Herring, a possible candidate for governor in 2017, has “put his personal agenda above the policy of Virginia.”

The attorney general already had won praise from gay-rights advocates — and derision from many conservatives — for refusing to defend Virginia’s same-sex marriage ban. Herring sided with the same-sex couples who challenged the prohibition, arguing that it was unconstitutional.

Herring filed a friend-of-the court brief Thursday in the U.S. Supreme Court, which will hear arguments next month on a Cincinnati-based appeals court’s ruling upholding gay-marriage bans in four states.

“The Constitution created a government dedicated to equal justice under law,” Herring wrote. “That principle is not new. What is new is this generation’s recognition that that principle cannot be reconciled with governmental discrimination against gay people.”