Gov. Andrew Cuomo pardoned several illegal immigrants Monday in order to help them avoid deportation.

The New York Democrat, who is up for re-election this year, pardoned seven people who had minor criminal convictions, ranging from petty larceny to drug possession, his office said.

And with the pardons, Cuomo didn’t miss the opportunity to take a dig at the Trump administration and its “zero-tolerance” immigration policies that left thousands of minors separated from their families after illegally crossing the U.S.-Mexico border.

“At a time when President Trump and the Federal government are waging a war on our immigrant communities, New York stands firm in our belief that our diversity is our greatest strength,” Cuomo said in a statement.

“While President Trump engages in policies that rip children out of the arms of their mothers and tries to ramp up the deportation of New Yorkers to advance his political agenda of hate and division, we will protect our immigrant communities,” Cuomo continued. “With the Statue of Liberty in our harbor, New York will always stand against the hate coming out of Washington and instead serve as a beacon of hope and opportunity for all.”

CUOMO CLAIMS HE’S ‘UNDOCUMENTED,’ CHALLENGES OFFICIALS TO DEPORT HIM

The separation of minors from their parents was swiftly and harshly criticized by many on both sides of the aisle. After the national outrage, Trump signed an executive order in June allowing families to remain together in detention. The administration is still working on reuniting those who have been separated; nearly 1,200 were reunited by this week.

According to the U.S. Immigrations and Customs Enforcement agency, a 2017 executive order from Trump expanded the agency’s focus to include removing immigrants who have been convicted or charged with a criminal offense, among other things.

Frank Barker, 43, was among those pardoned Monday, according to the governor’s office. He was convicted for criminal possession of stolen property and controlled substances and identity theft which stemmed from a drug addiction.

Also pardoned are: Jose Rafael Cruz, 53, who was convicted of a sale of a controlled substance; Ludames De La Cruz, 53, who was convicted for an attempted sale of a controlled substance; Elpidio Rodriguez, 57, who was convicted of criminal possession of a controlled substance and operating a motor vehicle while intoxicated; Tamar Samuda, 35, who was convicted nearly two decades ago for low-level assault and petit larceny; Marino Soto, 43, who was convicted of criminal possession of a controlled substance; and Carlos Suarez, 41, who was convicted for petit larceny.

CUOMO SIGNS REPRODUCTIVE RIGHTS EXECUTIVE ORDER AHEAD OF TRUMP’S SCOTUS NOMINATION

Cuomo faces a primary challenger in Cynthia Nixon, an actress and progressive activist who has been credited with pushing the governor to the left in the race.

During the campaign, Nixon has called for the abolishment of ICE. Lauren Hitt, a spokeswoman for Nixon, told Newsday that while Cuomo’s pardoning was good, Nixon would do more to “end the deportation pipeline” by allowing undocumented immigrants to obtain driver’s licenses.

Republican gubernatorial candidate Marc Molinaro’s campaign accused Cuomo of political grandstanding with the pardons.

“Everything Andrew Cuomo does is for his own political benefit, regardless of whether it’s right, wrong or dangerous to the public,” spokeswoman Katherine Delgado told Newsday. “In this case, it’s all about trying to out-liberal Cynthia Nixon for the September primary.”

Cuomo has pardoned 34 people since taking office, according to a news release.

The Associated Press contributed to this report.