A U.S. judge in California on Friday ordered President Donald Trump's administration to pay the costs of reuniting immigrant parents and children separated at the Mexican border, rather than forcing the parents to pay.

The U.S. government is working to reunite around 2,000 children with their parents after they were detained and separated as part of Trump's "zero tolerance" approach to deter illegal immigration.

"It doesn't make any sense for any of the parents who have been separated to pay for anything," U.S. District Judge Dana Sabraw, who last month ordered that the children be reunited with their parents by July 26, said at a hearing in San Diego.