The Trump administration has said it is ending the deployment of 2,000 National Guard troops in Los Angeles.
Chief Pentagon spokesman Sean Parnell announced the decision in a statement.
Roughly 4,000 National Guard troops and 700 Marines had been deployed. It was not clear how long the rest would stay in the region.
The troops were tasked with protecting federal buildings and guarding immigration agents as they carry out arrests.
The deployment began in early June and was slated to last 60 days.
President Donald Trump ordered the deployment of about 4,000 California National Guard troops and 700 active duty Marines in early June to respond to a series of protests against immigration raids in and around Los Angeles.
Their deployment went against the wishes of state governor Gavin Newsom, who sued to stop the deployment.
A district court judge initially said Mr Trump acted illegally when he deployed the Guard over Mr Newsom’s opposition, but an appeals court said the administration could keep control of the troops. The case is continuing.
Mr Newsom said the National Guard’s deployment to LA has pulled troops away from their families and civilian work “to serve as political pawns for the president in Los Angeles”.
“While nearly 2,000 of them are starting to demobilise, the remaining guardsmembers continue without a mission, without direction and without any hopes of returning to help their communities,” he said in a statement.
“We call on Trump and the Department of Defence to end this theatre and send everyone home now.”
Demonstrations in the city and the region in recent weeks have been largely small impromptu protests around arrests.
Mayor Karen Bass, who set a curfew in place for about a week that she said had successfully protected businesses and helped restore order, applauded the troops’ departure.
She said in a statement: “This happened because the people of Los Angeles stood united and stood strong. We organised peaceful protests, we came together at rallies, we took the Trump administration to court — all of this led to today’s retreat.
“We will not stop making our voices heard until this ends, not just here in LA, but throughout our country.”
Subscribe or register today to discover more from DonegalLive.ie
Buy the e-paper of the Donegal Democrat, Donegal People's Press, Donegal Post and Inish Times here for instant access to Donegal's premier news titles.
Keep up with the latest news from Donegal with our daily newsletter featuring the most important stories of the day delivered to your inbox every evening at 5pm.