AUGUSTA, Maine — Maine’s Republican governor is directing the state’s 16 county sheriffs to detain immigrants upon request by federal immigration officers — or be removed from office.

Gov. Paul LePage threatened Tuesday to oust elected sheriffs who reject requests from immigration officers to hold jail detainees beyond their scheduled release dates. He said he’d take steps to remove any sheriff if he hears that an “undocumented, illegal alien” was released after a federal detention request.

The governor ratcheted up a dispute with Cumberland County Sheriff Kevin Joyce, who announced he would reject requests by U.S. Immigration and Customs Enforcement officials to hold prisoners in jail beyond their scheduled release unless there’s a court order.

The governor said Maine law requires sheriffs to obey his law enforcement orders. He said the Maine Constitution allows a governor to remove a sheriff from office following a “complaint, due notice and hearing.”

The governor signed an executive order in 2011 calling on “employees and officials” of Maine” to cooperate with the federal government on immigration matters. Joyce denies that the executive order would apply to him.

LePage didn’t mention Joyce by name, but it’s clear who was on his mind.

Joyce is sheriff of Maine’s most populated county, which is also home to a growing population of immigrants from Somalia, which was targeted by Republican President Donald Trump’s latest travel order.

Joyce said detainer requests from immigration officials are a problem when they’re not supported by a court order or warrant signed by a judge. Detaining individuals for up to 48 hours without probable cause could put him and the county at risk of lawsuit for violating their rights, he said.

“I’m still accepting ICE inmates, the ones that are brought in legally,” Joyce said Monday. “I’m not honoring detainer requests to hold someone beyond their release date so that ICE can put together their case.”

LePage argues that federal policy requires immigration officers to review the facts and make sure they have reasonable grounds and an administrative warrant before they ask local law enforcement agencies to temporarily detain individuals.

Zach Heiden, legal director at the ACLU of Maine, noted Massachusetts’ highest court recently ruled that state law doesn’t allow police officers there to hold individuals solely on the basis of a federal immigration detainer request. The governor also lacks legal basis to force sheriffs to honor immigration requests, he said.

“We’re not talking about law enforcement, we’re talking about detention: locking people up,” Heiden said.