Washington (CNN) New York Gov. Andrew Cuomo signed legislation on Wednesday that will allow the state to prosecute people who have received a presidential pardon for the same offense, which could potentially affect associates of President Donald Trump.

The bill, which was passed by the state legislature in May, closes New York's "double jeopardy" legal loophole that protected individuals who are pardoned by a president for federal crimes from being prosecuted at the state level for the same offense. The change goes into effect immediately and applies to future and past offenses, provided a plea has not been entered and a person has not already been tried.

"No one is above the law and New York will not turn a blind eye to criminality, no matter who seeks to protect them," Cuomo, a Democrat, said in a statement . "The closure of this egregious loophole gives prosecutors the ability to stand up against any abuse of power, and helps ensure that no politically motivated, self-serving action is sanctioned under law."

The new law potentially short-circuits Trump's ability to shield his associates from prosecution, including former campaign chairman Paul Manafort, who was sentenced to more than seven years in prison on financial crimes stemming from special counsel Robert Mueller's investigation into the 2016 campaign.

The New York Attorney General's office, which has vowed to investigate Trump and his business dealings, said in a release the new law establishes an additional exception "that would ensure that New York's criminal laws continue to apply to individuals who receive a presidential pardon and also have a connection to the president either by family or close professional relationship, or through a narrow set of other criteria."

Read More