The ship, which left the Port of L.A. around 7 a.m., was brought in amid fears of a surge in hospital demand brought on by the COVID-19 crisis. It was set up to help treat non-coronavirus patients to help Southern California hospitals handle the surge.
Officials say staff treated 77 non-coronavirus patients during the ship's time in Los Angeles.
Mark Ghilarducci, the director of California Governor's Office of Emergency Services, said Mercy's role was critical during the first stages of the pandemic.
Some crew members from the ship will remain in the area to continue providing support, including 40 going to the state-run alternative care site at Fairview Developmental Center in Costa Mesa.
State officials thanked the Navy for the help.
"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. We thank our colleagues in the U.S. Navy, FEMA and the federal administration for their support in allowing us to use the Mercy," said Cal OES Director Mark Ghilarducci.
The ship's departure had been expected after it began scaling back its mission in the last two weeks.
The ship arrived with about 800 active duty doctors, nurses and medical staff members on board. It initially had 1,000 beds available, but that was later scaled back to free medical staff for other missions.
The ship left San Diego on March 23 and arrived in Los Angeles four days later to provide relief by taking patients who were not infected with the virus.
The facility was designed to remain a strict non-coronavirus zone with protocols for testing patients and staffers.
But several crew members did test positive for the coronavirus and more than 100 were taken off the ship and temporarily quarantined because of potential contact with a person who tested positive.
Last month, a train engineer was accused of intentionally running a train off the tracks at high speed near the Port of Los Angeles in an attempt to crash into the Mercy.
The Pacific Harbor Line train derailed, running through the end of the track and crashing through barriers, finally coming to rest about 250 yards from the docked naval ship. Federal prosecutors allege train engineer Eduardo Moreno, 44, of San Pedro intended to hit the ship, saying he thought it was "suspicious" and did not believe "the ship is what they say it's for.'"
RELATED: Prosecutors: Engineer deliberately ran train off tracks in attempt to smash the USNS Mercy