A federal judge on Wednesday blocked President Donald Trump's deployment of National Guard troops in Los Angeles and ordered the troops to be returned to the state governor's control.

In June, Trump sent thousands of National Guard troops to the California city in the wake of protests over his administration ramping up immigration raids in Los Angeles.

US District Judge Charles Breyer stated that the Trump administration had not demonstrated that the city's protests justified federal control over the state's National Guard.

The Trump administration still retains control over 300 California National Guard troops six months after they were federalized, according to Judge Breyer.

He also dismissed the Trump administration's argument that the courts should refrain from intervening when a president takes control of state National Guard troops during an emergency.

The Founders designed our government to be a system of checks and balances, Judge Breyer noted in his ruling. Defendants, however, make it clear that the only check they want is a blank one.

The judge’s order is set to take effect on December 15, allowing the Trump administration time to appeal to a higher court.

The BBC has requested a comment from the White House.

Earlier this year, Trump deployed National Guard troops to several cities, including Portland, Oregon, and Washington, D.C., facing similar legal challenges and, in certain cases, being blocked by judges.

California Governor Gavin Newsom sued following Trump's initial troop deployment in June, but a court of appeals sided with the administration, deeming the protests in Los Angeles as justification for the federalization.

Newsom launched a new legal challenge in November, arguing that the protests had largely dissipated and that the troops were no longer needed.

During a court hearing, the Trump administration's lawyers argued for the troops' continued presence in LA, claiming federal immigration agents were still at risk.

Yet, Judge Breyer questioned the necessity of maintaining a military presence based on circumstances months after the initial deployment.

Experience teaches us that crises come and crises go, he commented, citing concerns over the creation of a national police force through the federal control of state troops.

This ruling adds to the series of legal hurdles Trump has faced regarding National Guard deployments, as he maintains that such actions are essential to maintaining law and order in Democratic-controlled cities.