A judge on Wednesday blocked an order due to take effect this week that required California prison employees to be vaccinated against COVID-19. 

Kern County Judge Bernard Barmann issued a temporary restraining order that prevents enforcement of the vaccination mandate for guards and peace officers represented by a powerful union while the court weighs a request for a preliminary injunction, the Sacramento Bee reported. 

The public health mandate due to take effect Friday will still apply to other employees who work in prisons that have health care facilities. 

CORONAVIRUS IN THE US: STATE-BY-STATE BREAKDOWN 

In this August 2016 photo, a row of general population inmates walk in a line at San Quentin State Prison in San Quentin, California.  (AP Photo/Eric Risberg, File)

It is aimed at heading off another coronavirus outbreak like one that killed 28 inmates and a correctional officer at San Quentin State Prison last year. 

In total, the virus has killed 240 inmates and 39 prison employees since the start of the pandemic. 

However, the California Correctional Peace Officers Association opposes mandates for its members. The group has a lot of influence with the state’s Democratic Party-controlled political structure. It contributed $1.75 million to Gov. Gavin Newsom’s successful fight against recall. 

Newsom has a reputation as one of the strongest proponents of vaccine mandates among state governors. His administration had ordered all state employees, including those in prisons, to be vaccinated or have regular COVID-19 testing. 

California Gov. Gavin Newsom speaks in San Francisco in September. (AP Photo/Jeff Chiu, File)

CLICK HERE TO GET THE FOX NEWS APP 

Yet Newsom was opposed when last month a federal judge ordered that all employees entering California prisons be vaccinated or have a religious or medical exemption. The ruling by U.S. District Judge Jon Tigar did away with an option for prison employees to avoid vaccination and instead undergo frequent COVID-19 testing. 

Newsom filed a notice Tuesday that the state plans to appeal that ruling, leaving it in limbo.