WASHINGTON — An inmate at a federal jail in New York City has tested positive for coronavirus, marking the first confirmed case in the federal prison system.

The inmate, who is housed at the Metropolitan Detention Center in Brooklyn, complained of chest pains on Thursday, a few days after he arrived at the facility, the federal Bureau of Prisons told The Associated Press. He was taken to a local hospital and was tested for COVID-19, officials said.

The inmate was discharged from the hospital on Friday and returned to the jail, where he was immediately placed in isolation, the agency said. The Bureau of Prisons learned Saturday that he had tested positive for COVID-19.

The inmate remained isolated away from other prisoners on Saturday, but medical and psychiatric staff were visiting him routinely, officials said.

The confirmation of the first coronavirus case in the system by the BOP comes as jails and prisons across the country are taking precautions to slow the spread of coronavirus. Health officials have been warning for more than a decade about the dangers of outbreaks in jails and prisons, which are ideal environments for viruses: Inmates share small cells with total strangers, use toilets just a few feet from their beds, and are herded into day rooms where they spend hours at a time together.

There have been two positive cases among BOP staff members: an employee who works at an administrative office in Grand Prairie, Texas, and another employee who works in Leavenworth, Kansas, but who officials said did not have contact with inmates since becoming symptomatic.

The Bureau of Prisons has temporarily halted visitation at all 122 federal correction facilities across the U.S., including both social and legal visitation, though officials have said some exceptions could be made for legal visits.

Officials said staffers at the Metropolitan Detention Center would continue to monitor the inmate and they were working to trace who he had contact with, as well as sanitizing “affected areas.” Other inmates who were housed with the man are also being quarantined, along with staff members who may have had contact with him.

Every staff member and contractor entering the Metropolitan Detention Center is subject to an enhanced medical screening, including having their temperature taken with an infrared thermometer and are asked a series of questions to screen for coronavirus risk factors, a Bureau of Prisons official wrote in a letter to the chief judge in the Southern District of New York earlier this week.

The agency said inmates at the lockup are free to walk about their housing units and use common areas but may also choose to “remain in their cells to self-seclude.” But officials said they were not going to isolate inmates who may be considered to be “at risk” because there were too many of them to isolate them on one or two units, according to the letter.

For most people, the new coronavirus causes only mild or moderate symptoms, such as fever and cough. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia, and even death.

The vast majority of people recover from the virus. According to the World Health Organization, people with mild illness recover in about two weeks, while those with more severe cases may take three to six weeks to recover.