New York City would be barred from jailing an arrestee based solely on the federal government's claim that the person is in the country illegally, under a bill to be introduced in the City Council next week.

Sponsors of the bill said Thursday that such detentions would be allowed only under a federal judge's warrant -- and then only if the arrestee had been convicted within five years of a "violent or serious crime."

Also, the U.S. Immigration and Customs Enforcement agency would be evicted from Rikers Island, where it now maintains an office to facilitate its local detention program.

"Families will no longer be needlessly torn apart by ICE's dragnet enforcement efforts," said Council Speaker Melissa Mark-Viverito (D-Manhattan), who plans to introduce the bill at a meeting Tuesday.

Mayor Bill de Blasio said he backs the measure, and NYPD Commissioner William Bratton said he supports the goals of the bill's backers. ICE spokesman Luis Martinez wouldn't discuss the agency's Rikers operation or the bill but sent a statement that his agency would "continue to work cooperatively with law enforcement partners."

Over 3,000 people were transferred by the city to immigration authorities between October 2012 and September 2013 under what's called a "detainer," the speaker's office said.

Earlier this year, the jail agencies in Nassau and Suffolk counties said that absent a warrant, they were curtailing cooperation with immigration authorities.

Sign up to get the latest updates Get Newsday's Breaking News alerts in your inbox. By clicking Sign up, you agree to our privacy policy.

Under a federal program called Secure Communities -- a program dating to 2008 in which arrestees' fingerprints are checked against immigration databases -- more than 369,000 immigrants have been deported or voluntarily left to go back to their native lands.

More than 200 jurisdictions nationwide have pulled out of the program; thousands still participate, says ICE's website.

But federal judges in Oregon and Pennsylvania have ruled that the detention requests violate the constitutional right not to be held without probable cause. Those courts' decisions are not binding on New York.

The city's participation in the program is already limited by laws passed by the council in recent years. The city still honors warrantless detainers if an arrestee is accused of a felony or certain misdemeanors.

Ira Mehlman of the pro-enforcement Federation for American Immigration Reform, or FAIR, said the bill stops the city from taking "necessary precautions to remove people who might pose a danger."

Mehlman pointed to cases like one in San Diego last year in which a man later charged in his wife's slaying had been given bail on an earlier domestic violence case despite being in the country illegally. That municipality has a policy similar to the council proposal. He acknowledged that "illegal alien" arrestees are no more violence-prone than others, but said "these are people who don't have to be here. "