Democratic California Gov. Gavin Newsom on Monday pardoned several felons, two of whom are set to be deported, in what many saw as a rebuke to President Donald Trump's crackdown on illegal immigration.

Newsom took office in January and has used the gubernatorial office to criticize and oppose the president on a myriad of policies, but especially illegal immigration.

Two felons were pardoned for crimes that made them eligible for deportation, from solicitation of murder to grand theft. All of those granted clemency had already served their prison terms for their crimes.

"By granting these pardons to people who are transforming their lives," read a statement from the governor's office, "the Governor is seeking to remove barriers to employment and public service, restore civic rights and responsibilities and prevent unjust collateral consequences of conviction."

Both of the felons who were set for deportation were Cambodian refugees who were brought into the country legally, but committed gang-related crimes later.

The pardons do not protect them from deportation proceedings, but the actions by Newsom will help their arguments in court to fight deportation back to Cambodia.

The governor compared the president to anti-immigrant "demagogues" who passed the federal Chinese Exclusion Act of 1882, a law that targeted a community for exclusion from immigration. He made the comments while speaking to the Asian Pacific Islander American Public Affairs Association ahead of the pardons.

The Asian Law Caucus celebrated the announcement from Newsom.

"We are deeply grateful to Governor Newsom for recognizing the plight of refugees who are being targeted by the Trump administration and for acting with compassion and leadership to stop their deportations," said a statement from Executive Director Aarti Kohli.

Newsom was criticized in March when he overrode state law and used his executive power, some say improperly, to halt capital punishment in California.