Michael Avenatti, best known as Stormy Daniels' lawyer, in Houston for child separation case

PHOTOS: Immigration crisis Michael Avenatti was in a Houston immigration court Tuesday morning to help reunite a Guatemalan boy who was separated from his mother at the border. >>See how photographers have chronicled the border immigrant crisis... less PHOTOS: Immigration crisis Michael Avenatti was in a Houston immigration court Tuesday morning to help reunite a Guatemalan boy who was separated from his mother at the border. >>See how photographers ... more Photo: Joe Frederick, STF / Associated Press Photo: Joe Frederick, STF / Associated Press Image 1 of / 53 Caption Close Michael Avenatti, best known as Stormy Daniels' lawyer, in Houston for child separation case 1 / 53 Back to Gallery

Celebrity attorney Michael Avenatti, who gained national fame for representing porn star Stormy Daniels in her defamation lawsuit against President Donald Trump, appeared in a Houston immigration court Tuesday to reunify a 9-year-old immigrant boy with his mother, who had been deported to Guatemala.

The attorney and cable TV fixture visited early-voting Iowa over the weekend after announcing a potential presidential bid. In Houston, he urged the goverment to immediately release Anthony Tobar Ortiz so that he could return to Central America with Avenatti that same day.

The boy last saw his mother three months ago when federal agents separated the two at the southern border and he celebrated his birthday alone in a federal shelter for immigrant children last week.

"There's no reason for this child to continue to be detained," Avenatti said.

NOT ENOUGH: Plan to reunite remaining separated children ruled 'unacceptable'

The Los Angeles attorney descended on the Rio Grande Valley at the height of national furor over the Trump administration's family separation policy. On Twitter he declared he was "entering this fight" to end "this outrageous conduct," even as Avenatti's law background and practice is focused on civil litigation and dozens of pro bono immigration attorneys volunteered for weeks in south Texas to find separated parents and children.

Under the now-rescinded policy, widely regarded as one of the biggest fiascos of Trump's presidency, more than 2,500 immigrant children were separated from their parents. The adults were prosecuted for the federal misdemeanor of illegal entry, then spent a few days in prison before being transferred to immigration detention centers. Their children were sent to federal shelters run by the Office of Refugee Resettlement.

Hundreds of parents were deported without their children, including Anthony's mother, Elsa Johanna Ortiz, and the government has struggled to find them. A California federal judge ordered their quick reunification in June, but as of last week, nearly 400 children remained in federal custody with their parents outside the United States.

CHAOS AT THE BORDER: Immigrant parents struggle to find separated children

The government said in recent court filings that it has no contact information at all for the parents of more than two dozen children, and has not been able to reach many others. The judge, Dana M. Sabraw, has criticized the government for risking "permanently orphaned" children if their parents cannot be found.

On Tuesday Avenatti and Ricardo de Anda, a Laredo immigration lawyer, asked the government to terminate Anthony's immigration case and allow them to immediately take the child to the airport and fly him back to Guatemala City. The mother had signed a legal document giving them permission to do so.

Rory Potter, an attorney for Immigration and Customs Enforcement, said the government opposed ending the case, but agreed to allow Anthony to return home through a procedure known as voluntary departure, effectively closing the legal matter, but not allowing for his immediate release.

In a press conference outside the courthouse, Avenatti called it an "absolute outrage."

"Trump and his cronies talk about wanting to return these kids to their parents, but when it really comes down to it, like you saw upstairs, they don't want to do that," he said. "They want to continue to send this message to the world that if people come to this country and are caught that basically their child is going to be detained, stolen from them, and their families are going to be destroyed."

IN DISPUTE: Houston officials reject claim that controversial shelter for migrant kids on verge of opening

De Anda said had the government agreed to formally terminate the case, Anthony would have been released from federal custody right then, whereas voluntary departure could take longer

"They are delaying as much as possible the reunification to further dampen the desires of refugees to come to America," De Anda said.

Potter, the government attorney, did not return a call for comment. Tim Oberle, a spokesman for Immigration and Customs Enforcement, said in an email that the agency couldn't comment on the case due to privacy concerns because it involved a minor.

Charles Foster, a veteran Houston immigration attorney who has advised President George W. Bush, said the government's response was completely routine.

"Voluntary departure is normally what we would want," he said.

Formally terminating cases means immigrants are freed without any compulsion for them to leave the country, while voluntary departure imposes penalties if people don't.

Despite all the bluster, Foster said, in practical consequences the latter amounted to the same result for Anthony.

Hours after the press conference, Avenatti posted on Twitter that the government had agreed to release Anthony late Tuesday after his "negotiating." Thousands responded on social media, with one user noting, "people can criticize and critique you all they want for being power and media hungry but any motivation aside, you are actually making America better."

Avenatti's co-counsel, De Anda, said officials had expedited the boy's voluntary departure, and that he would be flying back to Guatemala Tuesday night.

Many separated children remain without their parents.

The American Civil Liberties Union, which filed the California lawsuit forcing family reunifications, has criticized the government for not doing more to quickly reunite families. It said the government withheld contact numbers for parents for weeks and that it is taking an "unnecessarily long time" to grant children the voluntary departure orders Anthony quickly received.

The New York Times first reported on the boy's case in June. His mother, who raised Anthony alone, told the Times that she came here fleeing violent criminals in her Guatemala City neighborhood and to join her boyfriend, who is working here illegally in construction.

Instead the mother and son were separated after Border Patrol agents found them near McAllen in May. The mother said agents first told her that Anthony would be put up for adoption, then that the two would be returned to Guatemala together. Instead she was deported alone in June without any idea about what had happened to her son.

She found him only after her boyfriend contacted a lawyer who helped them locate the child in federal custody.

Avenatti, who took on Anthony's case after it was publicized, has rejected characterizations that he inserted himself into the family separation issue to remain in the national limelight, telling the Washington Post in June that argument was "a bunch of nonsense, and it's offensive — highly offensive."

He said he did not seek out family separation cases, but was contacted by families asking him for help and that he was doing so pro bono. He now represents more than 70 such children.

Not an hour after leaving Houston's immigration court Tuesday, Avenatti posted on Twitter a summary of his views on various political issues were he to wage an outsider Democratic bid for the White House. They included a "basic Medicare plan for all Americans," a path to citizenship for young immigrants here illegally known as "dreamers," and decriminalizing marijuana on the federal level.

"Many have asked me my position on various issues," he said. "More positions & details will follow."

At HoustonChronicle.com: A Houston night with Stormy Daniels, the Trump-controversy stripper

lomi.kriel@chron.com

@lomikriel