The hospital ship USNS Mercy, which sailed into the Port of Los Angeles to serve as a relief valve while area medical centers coped with the burgeoning coronavirus pandemic, will leave the area Friday and return to its home port in San Diego.

According to the Governor’s Office of Emergency Services, some medical personnel from the ship will remain in the region to continue supporting the area’s response to COVID-19.

The 1,000-bed hospital ship treated close to 80 patients during its seven-week stay at the local port complex.

“Every patient brought aboard created one more available bed in a local hospital,” Capt. John Rotruck, the ship’s commanding officer, said in a statement. “Although USNS Mercy is departing the Port of Los Angeles, a number of our medical treatment personnel will continue our mission in Los Angeles through their support to state health care providers at various skilled nursing facilities.”

The ship sailed into the port on March 27 as local health authorities prepared for a feared surge of coronavirus cases that could have overwhelmed Southland hospitals. The ship was not brought in to treat COVID-19 cases, but to handle other patients and free up hospital beds for virus treatment.

The ship’s tenure in the Los Angeles, however, met with a few problems.

A few days after its arrival a train engineer was accused of intentionally driving a speeding locomotive off a track at the Port of Los Angeles because he was suspicious about the ship’s presence. The locomotive crashed through a series of barriers and fences before coming to rest more than 250 yards from the Navy ship.

And on April 15, seven crew members tested positive for COVID-19 and had to isolate off the ship. Just over 100 crew members who were in contact with were also quarantined.

According to the Office of Emergency Services, more than 60 of the ship’s personnel will remain in the area to continue assisting local medical efforts. Four six-member medical support teams will be deployed as needed to facilities including skilled nursing homes. Another 40 staffers will be assigned to the state’s alternative care site established at the Fairview Developmental Center in Costa Mesa.

“Our work to protect public health and safety is far from done but having the Mercy and its highly trained medical personnel stationed in the most populous region of the state was critical to our ability to respond in the first stages of the pandemic,” Cal OES director Mark Ghilarducci said. “We thank our colleagues in the U.S. Navy, FEMA and the federal administration for their support in allowing us to use the Mercy.”