Federal investigators found a loaded gun Thursday that had been smuggled into the jail where Jeffrey Epstein killed himself last summer, following a weeklong lockdown that turned up other contraband and led to a criminal probe into guard misconduct, the federal Bureau of Prisons told The Associated Press.

The handgun was located by Bureau of Prisons officers inside a housing unit at the Metropolitan Correctional Center in Manhattan, prison officials said in a statement to the AP. It marked a massive breach of protocol and raised serious questions about the security practices in place at the Bureau of Prisons, which is responsible for more than 175,000 federal inmates, and specifically at the jail, which had been billed as one of the most secure in America. Officials have not said where specifically the gun had been found, or how it had been smuggled inside the jail.

Meanwhile, federal prosecutors opened a criminal investigation into potential misconduct by guards, focusing on the flow of contraband into the lockup uncovered during the search for the gun, three people familiar with the matter told the AP. They were not authorized to discuss the investigation and spoke on condition of anonymity.

Attorney General William Barr named a new director last week to take charge of the agency, which has been the subject of intense scrutiny since Epstein took his own life while in custody in August. But the agency has been plagued for years by serious misconduct, violence and a chronic staffing shortage

DOJ OPEN CRIMINAL PROBE INTO POTENTIAL CONTRABAND FLOW AT NYC JAIL WHERE EPSTEIN WAS HELD: REPORT

The investigation and search at the Manhattan facility began last week after officials received information that a gun may have been smuggled into the lockup and placed the jail on lockdown "in order to protect the public, staff and inmates until a comprehensive search could be completed,” the agency said in a statement.

Since then, officials have been keeping inmates locked down in their cells without access to their lawyers and canceled all visitation at the jail, which houses about 700 inmates. In the past few days, officers have searched the facility and uncovered a sizable amount of contraband, including cellphones, narcotics and homemade weapons, the Bureau of Prisons said.

“All of these items pose a significant threat to the safety and security of the facility as well as the public,” the agency said in a statement.

Investigators were planning to continue searching the jail throughout the night Thursday, looking for any additional contraband, and the lockdown was expected to continue. Federal prosecutors are trying to determine how the it has all been entering the facility and the Bureau of Prisons said it notified the Justice Department's inspector general and the FBI.

"The BOP is committed to the safety of staff, inmates and the public while continuing to ensure that those responsible for misconduct and criminal activity are held accountable,” the statement said.

BARR REMOVES US PRISONS CHIEF FOLLOWING EPSTEIN'S DEATH IN JAIL 

The Metropolitan Correctional Center in New York City.

The Metropolitan Correctional Center in New York City. (AP)

All visitors and inmates are searched before entering the facility and go through metal detectors. They are supposed to leave personal belongings outside the jail. All mail is also screened by correctional staff.

The Bureau of Prisons said the jail has been on “modified operations” because of the investigation and didn’t provide an estimate for when normal operations could resume. Defense attorneys have raised concerns because the jail houses pretrial inmates while their cases are ongoing.

David Patton, executive director and chief attorney of the Federal Defenders of New York, said it’s a violation of inmates’ constitutional rights to deny them visits with their lawyers. He also said it has affected legal proceedings.

“Sentencings are being delayed. Hearings are being delayed,” Patton said. “But the MCC acts as though it’s perfectly fine for them to just shut down the entire institution to look for contraband. It’s just not acceptable. They’ve got to be able to walk and chew gum at the same time.”

EPSTEIN GUARDS SUSPECTED OF FALSIFYING LOGS TO SHOW THEY WERE CHECKING ON HIM: REPORT 

The agency said Thursday that it arranged for additional staff from other parts of the U.S. to assist in the investigation and ensure there is appropriate staffing at the jail. The agency said it “has maintained communication with stakeholders as needed” and held a meeting with the chief federal judge and public defender in Manhattan, along with prosecutors, the Marshals Service and probation officials.

The agency also said it has discussed a plan to resume legal visits at the jail on Friday and expects to allow full legal visitation by next week. Visits with family members could resume as soon as this week, officials added.

“The Bureau has been working closely with the stakeholders throughout this period to ensure those defendants with imminent court deadlines have the legal visits with their legal counsel as needed,” the statement said.

Inmates are being locked down for 24 hours a day, and lawyers have been told that on some units the prisoners are being denied showers and being given cold meals in their cells. One inmate reported receiving peanut butter and jelly sandwiches for every meal since last Thursday.

The bureau said inmates are on a periodic shower rotation, except for those in special housing units, who remain on a regular schedule.

“All inmates have access to medical care and appointments and medical staff continue normal rounds on every floor,” the Bureau of Prisons said.

CLICK HERE FOR THE FOX NEWS APP

It is just the latest crisis at the jail, which houses a number of high-profile inmates, including attorney Michael Avenatti, who gained fame by representing porn actress Stormy Daniels in lawsuits involving President Donald Trump. Federal prosecutors allege that the two correctional officers assigned to watch Epstein’s unit were snoozing and shopping on the internet when he took his own life in his cell in August, and later forged records to make it look like they checked in on him.