Federal immigration officials have notified Prince William County and other localities that they will extend a controversial program that seeks to identify undocumented immigrants once they are booked into local jails, officials said.

The program, which allows local police officers to investigate and detain illegal immigrants serving jail time and hand them over to federal authorities, was set to expire in Prince William at the end of Monday. However, Immigration and Customs Enforcement officials notified Prince William recently that its program, called 287 (g), would be extended in Prince William’s regional jail through at least June 30, said Prince William Board Chairman Corey A. Stewart (R-At Large).

However, area task forces on the street who investigate the presence of undocumented immigrants will no longer be able to operate under the agreement, ICE officials said. The jail program will allow the 39 local jails nationwide who have similar agreements to detain all those arrested and booked if they are found to be in the country illegally.

“I don’t give credit to the Obama administration often, but you have to give credit where credit is due,” said Stewart, who was pleased with the decision. “They should be complimented for that. … We have received no complaints from the federal government with regard to how we’re implementing it.”

Dani Bennett, an ICE spokeswoman, said in a statement that maintaining the jail agreements is part of “smart and effective immigration enforcement.”

Prince William officials say they have detained more than 5,500 illegal immigrants since the program began in 2007. However, whether federal officials actually deport those detained has remained a sticking point — the county has sued the federal government seeking more information on how many of those detained are actually deported.

Critics have said the 287 (g) program seeks to deport those guilty of less serious crimes — a strain on state and federal resources — as well as encourages racial profiling.

Claire Guthrie Gastanaga, the executive director of the ACLU of Virginia, said that state and local police should not be involved with enforcing federal immigration law at all. “[Local involvement] only imposes increased costs on the state with no positive benefit to public safety, and with proven adverse effects on the success of community policing,” she said in an e-mail.