Federal officials say they recovered a loaded gun inside the Metropolitan Correction Center on Thursday, ending a frantic search that placed the entire lower Manhattan jail under severe lockdown for the last week.

The handgun, which was found by Bureau of Prisons investigators inside a housing unit, represents another serious security breach inside the facility where Jeffrey Epstein died last year. The Associated Press reports that federal prosecutors are now opening a criminal investigation into potential misconduct by guards who allowed contraband to flow into the jail.

While searching for the gun, investigators said they also uncovered cell phones, narcotics, and homemade weapons. The facility will remain on "modified operation" through the weekend, federal officials said, to "finalize searches in all areas of the facility."

Detainees say that they have been locked inside their cells since the search for the gun began last Thursday. One detainee who was taken to a plea hearing this week said he had received only peanut butter sandwiches for every meal for a week. Investigators pepper-sprayed his unit, he alleged, and were preventing detainees from showering or using phones to speak with their attorneys.

The federal jail has a population of roughly 760 people—nearly twice the number it was originally built to accommodate. The vast majority have not yet been convicted of a crime.

David Patton, an executive director with Federal Defenders, said he could not recall a lockdown of this length in the last two decades. "A search for contraband should not result in the total denial of access to counsel for 8 days (and counting for most of the detainees)," he wrote in an email to Gothamist.

Officials say that two of the units will be available for legal visits on Friday, and the remainder are expected to reopen on Monday.