With all the creepy clown sightings lately, it’s worth noting that Virginia still has a law on its books that prohibits wearing a mask in public.

But thanks to a group of Virginia bicyclists, the law was tweaked two years ago to make the Commonwealth safe for balaclavas — and warmer for winter cyclists.

The law — Section 18.2-422 — still makes it illegal for anyone over 16 to wear a mask in public with the intent to conceal his identity. Violation of the law is a Class 6 felony that could land you in prison.

There are, however, several exceptions: medical masks or protective masks are legal, as well as Halloween costumes and masks worn for a “bona fide theatrical production or masquerade ball.”

But then a Richmond police officer threatened to lock up a mask-wearing bicyclist. Michael Gilbert, who wrote about his experience on the Virginia Bicycling Federation website, had been threatened with a felony for wearing a mask while bicycling on a winter day after being stopped for another violation.

“It was a police woman . . . who pulled him over and gave him a hard time. She said, ‘I could arrest you for wearing a mask right now,’ ” said Champe Burnley, who is president of the VBF. “He’s a year-round cyclist.”

So the group approached Del. Delores L. McQuinn (D-Richmond) to try to change the law.

Lloyd J. “Bud” Vye, the treasurer and advocacy director for the VBF, said Thursday that Virginia is not the only state with a law banning masks. Many states have them on the books for at least two reasons, he said: to add more legal firepower against anyone who does a stickup wearing a mask, and to combat the Ku Klux Klan.

It took two years, but the General Assembly passed a bill in 2014 that amended the law by adding language on intent. Vye thinks it didn’t hurt that on the winter day he testified before the Courts of Justice committee about bicycling in winter, the temperature outside was 9 degrees.

The upshot? It’s now conceivable that some clowns can carry concealed firearms in public if they have a proper license, but they had still better exercise caution when concealing their faces.

“I can tell you now, you still don’t want to go into a bank with a mask on,” Vye said.