RICHMOND, Va. (AP) — A Virginia judge issued a temporary injunction Monday blocking the enforcement of a law that banned a type of electronic betting machine that had proliferated in gas stations, bars and other locations around the state.

The injunction puts the so-called skill game ban on hold until a trial set for May, said Bill Stanley, a GOP state senator and attorney representing former NASCAR driver Hermie Sadler. Sadler's truck stop and gas station company brought the lawsuit.

Stanley said he was headed with Sadler on Monday evening to a company truck stop to turn the machines there back on.

“All we’ve ever wanted was to be treated fairly. And tonight’s ruling gives us a feeling that we’re going to get that,” Sadler said.

The Virginia General Assembly voted in 2020 to ban the machines, but operators got a one-year reprieve after Gov. Ralph Northam asked lawmakers to delay the enactment by a year and instead tax the machines and use the revenue to help fund coronavirus relief efforts. The ban took effect this July.

Lawmakers took on the machines at the same time they were clearing the way for other types of gambling, including opening the doors for casinos in Virginia for the first time. Companies that make and distribute the machines spent heavily on campaign donations and lobbying in an attempt to keep them legal in Virginia.

The games look and play like slot machines, though the manufacturers say there is an element of skill involved.

Sadler’s company filed suit this summer against Northam, Attorney General Mark Herring and the state Alcoholic Beverage Control Authority.

His company argued in court documents that the ban has caused confusion about what a “skill game” is and has hindered law enforcement's ability to prohibit illegal games. The lawsuit argues the ban is unconstitutional and has adversely impacted small businesses.

A spokeswoman for Attorney General Mark Herring did not respond to a request for comment.

A spokeswoman for Northam declined comment.

The case was heard in Greensville Circuit Court after the attorney general's office sought unsuccessfully to move the case to Richmond.