New York Gov. Andrew Cuomo signed a measure Wednesday that would allow the state to pursue charges against people who have received a presidential pardon — a law seen as a direct shot at President Donald Trump.

Multiple ex-Trump aides or associates are imprisoned or facing legal scrutiny in New York.

The president, whose business and campaign are both headquartered in New York, also is facing numerous federal, state and congressional investigations related to his administration, campaign and business dealings.

The newly signed law creates a narrow exception in the state's double jeopardy law, which prohibits the prosecution of a person who's been tried for the same crime by the federal government. The change takes effect immediately.

"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 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 York measure was introduced by state Attorney General Letitia James, who began investigating the finances of the president and the Trump Organization earlier this year. That probe came after Cohen told Congress that Trump had inflated the worth of his assets in financial statements to secure bank loans.

James has said the law was necessary because double jeopardy "exists to prevent someone from being charged twice for the same crime, not to allow them to evade justice altogether."

"We have a responsibility to ensure that individuals who commit crimes under New York state law are held accountable for those crimes," James said in a statement Tuesday.

"This critical new law closes a gaping loophole that could have allowed any president to abuse the presidential pardon power by unfairly granting a pardon to a family member or close associate and possibly allow that individual to evade justice altogether. No one is above the law, and this commonsense measure will provide a reasonable and necessary check on presidential power today and for all presidents to come."

Trump has dismissed her efforts as "presidential harassment." The White House did not immediately respond to a request for comment from NBC News.

"With the President all but pledging to corruptly abuse his pardon power to allow friends and associates off the hook, it is crucial that we have closed the Double Jeopardy loophole and preserved the rule of law in New York," Democratic state Sen. Todd Kaminsky, who sponsored the legislation, said in a statement.

Download the NBC News app for breaking news and politics

The New York Assembly and Senate passed the bill to end the so-called "double jeopardy loophole" in May.

Democratic state Assemblyman Joseph Lentol, another sponsor, said the legislation "takes the incentive out of any scheme to thwart prosecution."

The new exception allows state prosecutors to pursue investigations into any pardoned individual who served in a president's administration, worked directly or indirectly to advance a presidential campaign or transition, or worked at a nonprofit or business controlled by a president, and whose alleged criminal activity took place in New York. The law also allows for investigations to be opened or continued into anyone who was pardoned for the president's benefit.

The measure was proposed after reports that Trump was weighing a pardon for his former campaign manager, Paul Manafort, who's serving a 7½-year prison term on federal bank fraud, tax evasion and conspiracy charges stemming from former special counsel Robert Mueller's investigation into Russian interference in the 2016 presidential election.

In addition to the federal conviction, Manafort was indicted on state mortgage fraud charges in March by the Manhattan district attorney's office. That office has also launched a criminal investigation into the Trump Organization over two hush money payments during the 2016 campaign to women who claim they had affairs with Trump.

Mueller's 400-plus page report scrutinized Trump's comments on possibly pardoning Manafort, as well as ex-longtime attorney Michael Cohen, who was involved in the hush payments, and former national security adviser Michael Flynn.

While presidents can pardon federal crimes, they cannot pardon state offenses.