More than 50 people circled the governor's mansion in Annapolis on Aug. 13 to protest Gov. Larry Hogan's decision to cooperate with federal officials in their immigration enforcement efforts. (Ovetta Wiggins/The Washington Post)

MARYLAND GOV. Larry Hogan, whose record in his first seven months in office qualifies him as among the nation’s least partisan Republican chief executives, is under unfair attack from immigration activists. They’re unhappy that he is cooperating with the Obama administration’s new — and far more lenient — policy on detaining and deporting undocumented immigrants. In fact, Mr. Hogan’s stance, adopted without announcement after he took office in January, is the right and responsible thing to do.

The governor is the target of criticism mainly because immigration activists apparently oppose deportation in practically every instance, without regard to whether a deportee is a felon, terrorist, repeat offender, domestic abuser or sexual predator. How else to understand why they would seek to undercut the Obama administration’s policy, announced last fall and in effect since July 1, known as the Priority Enforcement Program?

Under that program, the Department of Homeland Security requests cooperation from local law enforcement agencies preparing to release certain undocumented immigrants from jail. The department wants a heads-up before they are released so federal agents can detain them and process them for deportation — but only if they fit in certain well-defined categories.

Those categories include suspected terrorists and spies; gang members; convicted felons; domestic and sexual abusers; drug dealers and drunk drivers. Undocumented immigrants jailed for routine traffic and other minor offenses are explicitly excluded as priorities for detention or deportation. In all, according to a recent report by the Migration Policy Institute, about 13 percent of the estimated 11 million undocumented immigrants — mainly criminals and recent illegal border-crossers — would be targeted for deportation. The other 87 percent of generally law-abiding immigrants are not a focus of the administration’s deportation efforts.

That strikes a good balance. It’s nonsense to suggest, as some immigration activists do, that local law enforcement agencies undercut their relations with immigrant communities by cooperating with federal officials. Like any other community, immigrants can and do distinguish between bad actors and good.

In complying with the administration’s policy, Mr. Hogan is doing nothing more than instructing state prisons and the Baltimore city jail, which is under the state’s aegis, to cooperate with federal officials by giving 48 hours’ notice to Immigration and Customs Enforcement before undocumented immigrants are released from custody, so they they can be screened for criminal activity and detained by ICE if they fall into an offending category.

It was precisely that sort of cooperation that was lacking when San Francisco authorities released Juan Francisco Lopez-Sanchez this spring. Mr. Lopez-Sanchez, an illegal immigrant who had served various prison terms for a criminal record in four states reaching back to 1991, and who had been deported five times previously, was allowed to walk out of jail unencumbered under the city’s sanctuary policy which, applied blindly, gives dangerous criminals a free pass to re-enter society. A few months later, according to his own account, he fatally shot Kathryn Steinle, a 32-year-old woman who was strolling on a city pier with her father.

Unlike many elected Republicans, Mr. Hogan has not made an issue of illegal immigration; in fact, he’s generally avoided the topic. In acceding to the Obama administration’s request for cooperation, he’s not joining the ranks of immigrant-bashers; he’s simply applying common sense to an issue that involves public safety.