The U.S. Supreme Court declined Monday to take up an appeal of a lower-court ruling that struck down Virginia’s anti-sodomy law, halting state Attorney General Ken Cuccinelli II’s long-standing legal efforts to preserve the statute.

Cuccinelli is the Republican nominee for governor on the Nov. 5 ballot, and Virginia’s “crimes against nature” law — which bans oral and anal sex — has become a flash point in his contest against businessman Terry McAuliffe (D), who has portrayed Cuccinelli as an extremist on social issues.

Cuccinelli and other defenders of the law, including local prosecutors, have said that it is a vital tool for stopping child predators. Cuccinelli has said that the law “is not — and cannot be — used against consenting adults acting in private.”

The Supreme Court ruled in 2003 that sodomy statutes criminalizing sexual activity between consenting adults were unconstitutional. Based on that ruling, a three-judge panel of the U.S. Court of Appeals for the 4th Circuit ruled in March 2013 that Virginia’s statute was unconstitutional.

The ruling focused on a case from 2005 in which a 47-year-old man was convicted of soliciting oral sex from a 17-year-old girl. Cuccinelli first appealed the case to the full 4th Circuit and then asked the Supreme Court to step in.

“This case was about using a law that has been repeatedly upheld by Virginia courts to protect a minor from a 47 year-old repeat sexual predator,” said Brian Gottstein, a spokesman for the Virginia attorney general’s office. “We appealed to the Supreme Court to save a tool Virginia law enforcers use regularly to prosecute child predators. As we’ve said from the beginning, this case had nothing to do with sexual orientation or private acts between consenting adults.”

The McAuliffe campaign has previously called the sodomy law defense an example of Cuccinelli’s “extreme agenda and uncompromising approach,” and Cuccinelli said in 2009 he believed “homosexual acts are wrong and should not be accommodated in government policy.”

McAuliffe has called for the law to be updated so it could still target predators without violating the 2003 Supreme Court ruling. Cuccinelli’s campaign sought to use the issue against McAuliffe, accusing the Democrat of “playing politics instead of protecting our children.”

James Parrish, the executive director of the gay rights organization Equality Virginia, said the General Assembly has had 10 years since the first Supreme Court ruling to update its law and has not done so. As a state senator in 2004, Cuccinelli voted against a bill that would have made clear that the law no longer covered private consensual acts between adults.

“In our view, this was already decided, and the Supreme Court just echoed that” Monday, Parrish said. “I’m sure most Virginians would like to see the General Assembly clean up our code.”