A judge in California has ordered US border authorities to reunite separated families within 30 days.

If the children are younger than five, they must be reunified within 14 days of the order on issued Tuesday.

More than 2,000 children have been separated from their parents in recent weeks and placed in government-contracted shelters.

President Donald Trump last week issued an executive order to stop the separation of families and said parents and children will instead be detained together.

US District Judge Dana Sabraw in San Diego issued the order in a lawsuit by the American Civil Liberties Union.

The lawsuit involves a seven-year-old girl who was separated from her Congolese mother and a 14-year-old boy who was separated from his Brazilian mother.

Mr Sabraw also issued a nationwide injunction on future family separations, unless the parent is deemed unfit.

In a separate action launched on Tuesday, 17 states began proceedings to sue Mr Trump’s administration to force it to reunite the thousands of immigrant children and parents who have been separated at the US-Mexico border.

The states, including New York and California, joined Washington DC in filing the lawsuit in federal court in Seattle.

All led by Democratic attorneys general, they argue that they are being forced to shoulder increased child welfare, education and social services costs.