DENVER — For four years Arturo Hernández García, an immigrant from Mexico, tried every legal move to stop his deportation. As a last resort, he camped out in the basement of a church here, seeking sanctuary from federal agents trying to expel him.

Obama administration officials have long said they are not looking to deport undocumented immigrants like Mr. Hernández García — a taxpaying business owner and parent of an American citizen. But after he was arrested over a workplace argument in 2010, the immigration authorities were alerted to his status by a federal monitoring program. They began deportation proceedings that have continued to this day, even though he has been cleared of the criminal charges.

Mr. Hernández García was ensnared by an enforcement program known as Secure Communities, which connected local and state police departments across the country with federal immigration enforcement. Now the program, which generated the majority of the 2.3 million deportations under the Obama administration, is at the center of the battle between the president and Republicans over his executive actions to transform the deportation system.

Along with the hotly contested initiatives he announced in November allowing millions of unauthorized immigrants to stay and work legally, President Obama also canceled Secure Communities, replacing it with a new program that will greatly reduce the threat of deportation for immigrants like Mr. Hernández García who have no record of serious crimes. Under new, sharply revised priorities in the overhaul package, immigration agents will focus almost exclusively on deporting terrorists, gang members and felons who pose security risks.

Republicans, who now control Congress, describe Mr. Obama’s actions as an unconstitutional overreach and have vowed to reverse them. On Wednesday the House passed a Homeland Security funding bill that would cancel his programs protecting illegal immigrants. The measure would restore Secure Communities and increase its funding, while taking away the president’s authority to set priorities for deportation. Mr. Obama said Monday that he would veto the measure, which now goes to the Senate.

Representative Lamar Smith, Republican of Texas, called it “a reasonable response to the extreme actions the president has taken to undermine and rewrite our immigration laws.” Secure Communities, Mr. Smith said, helped federal agents “successfully remove hundreds of thousands of illegal immigrant criminals.”

But to administration officials, Secure Communities had become a liability, causing separations of long-settled immigrant families, fraying relations with police departments and generating damaging legal challenges. In a Nov. 20 memorandum canceling the program, Secretary Jeh Johnson of the Homeland Security Department said it had “become a symbol for general hostility toward the enforcement of our immigration laws.

For Mr. Hernández García, Secure Communities was the start of a torturous deportation process that continued inexorably even as administration officials insisted that they were going only after dangerous convicts.

Coming as a tourist 15 years ago, Mr. Hernández García stayed and built a business laying floor tiles, now with six employees. At a construction site in 2010, he had an argument with a worker from another crew who had trod on a freshly laid floor. The man called the police and Mr. Hernández García was arrested on an assault charge. His fingerprint check drew the attention of immigration agents.

He insisted on a trial, and was acquitted after witnesses confirmed that there had been no attack. “I’ve had all these problems because one person spoke falsely,” Mr. Hernández García said.

He and his wife, Ana, 40, who is Mexican, applied years ago for green cards through her father, an American citizen. Their applications are buried in processing backlogs. They have a Mexican daughter they brought here as a baby; another daughter, 9, was born in the United States. But an immigration judge who heard his deportation case was not convinced that it would be a hardship for his family if Mr. Hernández García was deported.

He spent New Year’s Eve in a chilly basement room at the First Unitarian Church with his family, singing karaoke to melancholy mariachi songs. The congregation has agreed to shelter him, since immigration agents generally refrain from entering churches to make arrests. This week, immigration prosecutors in Denver declined to cancel his deportation order, so he will present a new application to have it temporarily postponed.

“I want the citizens of Denver to know,” he said, “that we are not criminals.” Except for his deportation order, Mr. Hernández García has all the qualifications for a work permit under Mr. Obama’s new program.

Started in 2008, Secure Communities rapidly expanded under Mr. Obama to cover the entire country. Under the program, fingerprints of anyone booked by local or state police officers were shared with immigration agents. The agents could then issue orders, known as detainers, to the police to hold people suspected of being in the country illegally for up to 48 hours after release from local custody, giving agents time to detain them for deportation.

Official statistics show that agents modified their operations over time to deport more convicted criminals. But the government continued to expel immigrants following traffic stops or misdemeanor arrests, or after charges that never resulted in convictions.

The aggressive use of the program led to widespread protests. Demonstrators from the National Day Laborer Organizing Network, a tenacious adversary, chained themselves to detention center fences and lay down in roadways to block buses carrying deportees.

Some police departments also stopped participating in the program, saying it eroded trust with immigrant victims and witnesses. A 2014 law in California limited the police to honoring immigration holds only for serious offenders. Last week, the departing governor of Illinois, Pat Quinn, a Democrat, ordered the police to stop complying with any immigration detainers.

Several federal courts have found that the detainers violated constitutional rights against illegal seizure. By the end of last year, 270 jurisdictions were refusing to honor detainers, and during 2014 local police departments declined to respond to 10,182 of the orders, Homeland Security officials reported.

The replacement program devised by Mr. Johnson, called Priority Enforcement Program, will start in the coming weeks, and still relies on fingerprint checks at the time of bookings by the police. But instead of mandatory holds, immigration authorities will in most cases send only requests, asking for advance notice when the police plan to release immigrants after they have been convicted of crimes.

Agents will issue detainers only for immigrants who fit in the highest categories of the new priorities, which went into effect Jan. 5, and they will have to specify why they have probable cause to pursue deportation.

Juliet Stumpf, a professor at Lewis and Clark Law School in Portland, Ore., said the new plans were “a sea change” from the canceled program. “Instead of a hammer,” she said, “the administration is giving agents a screwdriver and an instruction manual and requiring them to follow it.”

But in Denver, Hans Meyer, an immigration lawyer, is still battling many deportations of immigrants snagged by the old program. “The administration has a big credibility hole to climb out of,” Mr. Meyer said.

At a hearing last month, he pleaded with an immigration judge to allow Mauricio Rosales, 32, a Mexican, to stay. Mr. Rosales was leaving a Broncos football game in a borrowed pickup truck when a policeman stopped him because of a dangling taillight. The officer ordered a blood test, and the two beers Mr. Rosales drank during the game were enough for a low-level misdemeanor of “driving while impaired.” He was sentenced to 15 days of probation.

Immigration agents, alerted by Secure Communities, went to the probation office to arrest him.

His wife, Roxana Burciaga, 22, an American, sat in court in a daze, trying to imagine how she would cope if she was left alone to care for their 14-month-old daughter and her two children from another marriage, all Americans, and her elderly grandparents, who depend on her help.

“I’m the only one who is working,” Mr. Rosales said, citing steady jobs as a carpenter.

Mr. Rosales might qualify for a work permit under Mr. Obama’s new program for undocumented parents of American citizens, and that could mean an end to the deportation case. Mr. Meyer won a few more months for Mr. Rosales to find out.