Federal investigators on Thursday recovered a loaded gun that had been smuggled into the notorious Manhattan jail where Jeffrey Epstein killed himself last summer.

The weapon was found at the Metropolitan Correctional Center after a weeklong lockdown that turned up other contraband, including cellphones and drugs, and led to a criminal investigation into guard misconduct, according to the federal Bureau of Prisons.

The handgun was located by Bureau of Prisons officers inside a housing unit at the jail, 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.

Bureau of Prisons officers found a smuggled gun inside a housing unit at the Metropolitan Correctional Center on Thursday, after a six-day lockdown

Meanwhile, federal prosecutors opened a criminal investigation into potential misconduct by jailers, 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.

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, 66, committed suicide while in custody in August. But the agency has been plagued for years by serious misconduct, violence and a chronic staffing shortage

The investigation and search at the jail began last week after officials got a tip 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.

Two correctional officers who were responsible for guarding Jeffrey Epstein on the night he hanged himself were allegedly shopping online for furniture and napping

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.

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.'

The agency said Thursday that it arranged for additional staff from other parts of the US 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 Manhattan jail currently houses disgraced attorney Michael Avenatti, who was convicted last month of trying to extort more than $20million from Nike

'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.

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 for furniture on the internet when he hanged himself in his cell on August 10, and later forged records to make it look like they checked in on him.

After they discovered the high-profile inmate dead, the officers allegedly told a supervisor they had 'messed up' and 'didn't do any checks' in the hours before he killed himself.

Jeffrey Epstein hanged himself on August 10 in his cell at the Metropolitan Correctional Center while awaiting trial on federal sex trafficking charges

The two guards are accused of repeatedly signing false certifications saying that they had conducted multiple counts of inmates during their shift.

The prisoners were not checked on for eight hours, according to the indictment. The guards discovered Epstein's body at 6.30am.

Epstein hanged himself on August 10 in his cell while awaiting trial on federal sex trafficking charges.

His death has triggered investigations by the FBI, the US Department of Justice's Office of Inspector General and the U.S. Bureau of Prisons, which runs the detention facility.

It also prompted outrage and disbelief over how such a high-profile prisoner, known for socializing with powerful people including presidents Donald Trump and Bill Clinton and Prince Andrew, could have been left without surveillance at the federal facility.

Epstein's suicide occurred despite a previous attempt on July 23 when he was found on the floor of his cell with bruises on his neck.