New York City would be banned from jailing an arrestee based solely on the federal government's claim of illegal immigration, under a bill to be introduced next week at the City Council.

The legislation would allow such detentions only if immigration authorities produce a federal judge's warrant -- and even then only if the arrestee had been convicted of a "violent or serious crime" within the previous five years, according to a Thursday morning news release from the council.

Additionally, the bill would evict the federal government's Immigration and Customs Enforcement from Rikers Island, where the agency now maintains offices to process requests to detain and deport those inmates suspected of illegally being in the United States.

"Families will no longer be needlessly torn apart by ICE's dragnet enforcement efforts," said the council's speaker, Melissa Mark-Viverito (D-Manhattan), who plans to introduce the bill at an Oct. 7 meeting. "We cannot allow for immigrant families looking for a better life for themselves and their children to be needlessly torn apart because of gaps in our laws."

More than 3,000 people were handed over to immigration authorities between October 2012 and September 2013 pursuant to what is known as a "detainer," according to Mark-Viverito's office, citing statistics from the city's jailer, the Correction Department.

Thursday's announcement comes as the jail agencies in both Long Island counties said this year that they were curtailing cooperation with immigration authorities, absent a warrant.

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 from around the country have withdrawn from the program. Thousands still participate, according the ICE 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.

New York City's participation in the program is already limited by several laws passed by the council over the last few years.

Still, according to Mark-Viverito's office, the city currently honors warrantless detainers if an arrestee is accused of a felony or certain misdemeanors.

Since Mark-Viverito became speaker in January, the council has promised to be more immigrant-friendly, including by passing a bill earlier this year creating a municipal ID card for city residents regardless of immigration status.