Being a communist would no longer be a fireable offense for California government employees under a bill passed Monday by the state Assembly.

Lawmakers narrowly approved the bill to repeal part of a law enacted during the Red Scare of the 1940s and '50s when fear that communists were trying to infiltrate and overthrow the US government was rampant.

The bill, which was authored by Democratic Assemblyman Rob Bonta, now goes to the Senate.

If passed there, it would eliminate part of the law that allows public employees to be fired for being a member of the Communist Party.

Being a communist would no longer be a fireable offense for California government employees under a bill passed Monday by the state Assembly. The bill, authored by Assemblyman Rob Bonta, D-Alameda, now goes to the Senate. Bonta is seen here during a legislative session, in Sacramento, California in August 2016

Employees could still be fired for being members of organizations they know advocate for overthrowing the government by force or violence.

The bill updates an outdated provision in state law, said Bonta.

Some Assembly Republicans said the Cold War-era law should not be changed.

Assemblyman Randy Voepel, a Southern California Republican who fought in the Vietnam War, said communists in North Korea and China are 'still a threat.'

'This bill is blatantly offensive to all Californians,' said Assemblyman Travis Allen, a Republican who represents a coastal district in Southern California. 'Communism stands for everything that the United States stands against.'

This isn't the first time such a measure has been brought in the California legislature.

Then Democratic state Senator Alan Lowenthal called for a similar repeal in 2008.

Courts had already declared the basic tenants of the longstanding law unconstitutional as a violation of First Amendment rights, Lowenthal told Fox 8 at the time.

'Being a member of the Communist Party in and of itself does not mean you advocate the overthrow of the government,' he said in April 2008. 'It doesn’t mean we agree with them, but they’re not a threat to our survival.'

Lowenthal is now a US Representative for California's 47th congressional district, and has been since 2013.