The Baker administration is reversing a Deval Patrick-era policy that barred the state police from detaining undocumented immigrants at the request of federal immigration officials in a major policy shift officials say is intended to capture dangerous convicts living in the country illegally.

The change, which administration officials say goes into effect today, is intended to reopen channels with Immigration and Customs Enforcement following the feds’ move to the Priority Enforcement Program (PEP) that intensifies the agency’s focus on criminals. PEP is a new version of the controversial Secure Communities program that was criticized for scooping up nonviolent immigrants with no criminal records.

But the move is also likely to draw fire from immigrant advocates, who have regularly railed against Gov. Charlie Baker’s stance on their issues and have long criticized the feds’ approach to deportation through Secure Communities.

Baker, in a Herald interview, said his administration has had “long conversations” with local officials who have worked with the feds — including in Chelsea, which has seen a huge influx of immigrants — to address concerns “raised historically about this being used in inappropriate ways.”

“I think this strikes the right balance,” Baker said, adding the policy is intended to focus on those who “pose a significant threat” to public safety.

“This was about working collaboratively,” the governor added, “that if there were people who had engaged in criminal activity, that the connectivity between the state and the feds would be there to ensure that we didn’t miss opportunities to remove them.”

The old policy — enacted in 2014 under then-Gov. Deval Patrick — prohibited the Massachusetts State Police from inquiring about a person’s immigration status unless it was tied to a criminal probe. The Patrick administration also ordered state police to stop honoring ICE requests to put temporary holds on those arrested and living in the country illegally.

Aides to Baker say state police still won’t be allowed to ask about someone’s immigration status, but the new policy will reopen the door to holding a suspect under arrest at ICE’s request for up to 48 hours.

State officials said such detainers are based on specific criteria — set by the Obama administration — that target suspected terrorists and illegals who have previous convictions on felonies, multiple misdemeanors that don’t include traffic offenses, or convictions in gang-related crimes.

The state’s new policy is in line with Baker’s past support of the federal programs. He said during the 2014 gubernatorial campaign that he had “concerns about restricting law enforcement’s ability to do their job,” and last year he vowed to veto a version of the so-called Trust Act floated in the Legislature that would have stopped local police from notifying immigration officials when illegal immigrants are arrested on some crimes.

“I certainly believe that any opportunity we have to use someone’s status as a tool in the tool kit that law enforcement has to protect the people in their communities, we should use that,” Baker said last August.

State public safety officials did not release a copy of the new policy or the orders they plan to distribute to police today, saying they intend to do so after they’re circulated internally.

The policy shift comes nearly 17 months into Baker’s first term and nearly a year after the feds fully implemented the Priority Enforcement Program. His aides say there wasn’t a particular incident or arrest that prompted the change, and David Procopio, a state police spokesman, said he was unable yesterday to quantify how many detainer requests police may have refused from ICE under the old policy.

Part of the problem, Baker said, is “the commonwealth stopped asking for them.”