Newly elected Anne Arundel County Executive Steuart Pittman (D) announced Thursday that he was pulling the county out of a controversial program that deputizes county detention officers to enforce federal immigration laws.

But Pittman reversed his position on ending an agreement to rent space at a county jail to U.S. Immigration and Customs Enforcement to house immigrant detainees. He said he would keep that program in place but use part of the revenue the county receives to help fund legal representation for the detainees housed there.

Whether and how much Anne Arundel should be involved with federal immigration enforcement was a key issue during the midterm elections, in which Pittman, a businessman, faced incumbent Republican Steve Schuh. While Gov. Larry Hogan (R) carried the county by a wide margin, down-ballot Democrats won big, with Schuh losing his seat and the county council shifting to a blue majority.

Schuh had signed the agreement with ICE in June 2017 under the federal agency’s program under section 287(g) of the Immigration and Nationality Act, which deputizes county officers to screen inmates for immigration offenses and allows them to file ICE detainers on selected inmates. At the time, officials said the move was aimed at combating the rise of the violent MS-13 street gang, which has some members who are Central American immigrants.

Anne Arundel detention officers began operating under 287(g) in December 2017, asking 193 foreign-born inmates at the county’s jail about their immigration status, according to a five-page report on the program the county released Thursday.

Of those, 69 had overstayed their visas or entered the country without documentation, according to the report.

The ICE program has come under scrutiny in Anne Arundel and elsewhere from immigrant-rights and civil liberties groups, who say it deters immigrants from seeking help from local law enforcement or cooperating with police and other authorities, for fear of being deported.

“There was a sense people in county government were working with ICE to implement an ICE policy that they saw as rounding up hard-working people in communities and deporting them,” Pittman said. “I think people will be pleased that 287(g) is no longer in effect.”

Gustavo Torres, executive director of the immigrant-advocacy group CASA, lauded the decision. “I believe it is the right approach, the right decision because in this particular moment, collaborating with ICE is collaborating with the cruel and racist policy of this administration,” Torres said, referring to President Trump’s hard-line stance on immigration.

The county has reverted to the protocol it followed before entering the federal program, said Terry Kokolis, superintendent of detention facilities. It sends inmates’ names and other information to the ICE field office in Baltimore, which can screen inmates for potential immigration violations and decide whether it wants to file detainers to take individuals into custody.

Nathalie Asher, acting executive associate director of ICE Enforcement and Removal Operations, said Pittman’s decision “undermines law enforcement partnerships and public safety.”

Anne Arundel was one of three Maryland jurisdictions that participated in the 287(g) program; Frederick County was the first, beginning in 2008, followed by Harford County last year.

The county will continue to rent space to ICE at its Ordnance Road Correctional Center, where it has 130 beds for that purpose.

Pittman said that while he had originally planned to pull out of that agreement as well, he changed his mind after speaking to advocates and detainees, who said the Ordnance Road facility was more “humane” than other immigrant jails in the country.

The county receives $118 per day to house each inmate, Pittman said, receiving $4 million last year.

While that money goes into the county’s general fund, Pittman said he was committed to routing it to public safety — and, in a new move, to fund legal representation for immigrants detained at Ordnance Road who cannot afford lawyers. Immigration offenses are civil, not criminal matters, so the government does not provide publicly funded attorneys.

Pittman said an estimated 10 to 15 percent of the revenue from housing ICE detainees would go to a program at the University of Maryland to provide lawyers for them.

Baltimore City and Prince George’s and Montgomery counties have launched or funded similar legal aid programs in recent years.

Anne Arundel is far from being a sanctuary jurisdiction, Pittman said, adding that the county has no interest in interfering with the federal government’s immigration work.

“We do local law enforcement, they do immigration enforcement,” Pittman said. “Let’s just let each other do our jobs.”

Asher said ICE was “currently evaluating” the contract through which it rents detention space from Anne Arundel.