On Saturday, US District Judge Fred Biery granted an emergency request from the family’s lawyer, ordering government officials to release the father and son by 3 February.

In his ruling, the judge also included a photo of Ramos in his fluffy blue hat.

“The case has its genesis in the ill-conceived and incompetently-implemented government pursuit of daily deportation quotas, apparently even if it requires traumatizing children,” Judge Biery wrote in his ruling.

Judge Biery, an appointee of former President Bill Clinton, said deportations through the US immigration system should occur through a more orderly and human policy than currently in place.

“Observing human behavior confirms that for some among us, the perfidious lust for unbridled power and the imposition of cruelty in its quest know no bounds and are bereft of human decency,” he wrote of the detention of Ramos.

The BBC has contacted the Department of Homeland Security for comment.

Marc Prokosch, a lawyer representing the family, said the boy and his father were being held at a detention centre in San Antonio, Texas.

Prokosch said Ramos and his father had come to the US in 2024 from Ecuador to seek asylum and had been following the proper immigration protocols.

In recent weeks, President Donald Trump has ramped up immigration enforcement efforts in Minneapolis in an initiative dubbed “Operation Metro Surge”.

On Thursday, Trump officials suggested they may start pulling back federal forces in the state after a national outcry over the fatal shootings of two US citizens in Minneapolis by federal agents.

In a separate ruling on Saturday, a federal judge denied a state government’s request to block the Trump administration’s deployment of thousands of immigration agents in Minneapolis, saying the state had not proven the activity was unlawful.