Updated

The attorney taking on President Donald Trump over his alleged affair with an adult film actress has appeared in Houston immigration court to try to secure the release of a 9-year-old boy from Guatemala.

A judge on Tuesday denied Michael Avenatti's request to dismiss the case against the boy.

Avenatti and another attorney, Ricardo de Anda, had offered to take the boy from court to the airport and fly him to Guatemala, where his mother was deported in June.

Instead, the judge ordered the boy to be removed once his case is formally processed by the government, which could take several weeks.

In addition to his legal fights on behalf of actress Stormy Daniels, Avenatti has taken up the cases of immigrant families separated under the Trump administration's zero-tolerance policy.