Melania Trump has made a surprise visit to the US-Mexico border as she seeks to reunite separated parents and children "as quickly as possible" amid a backlash over a "zero tolerance" policy on illegal arrivals.

The first lady has travelled to two Texas facilities housing some of the 2,300 migrant children being held by the government while their parents are being prosecuted for illegally crossing into America.

As his wife was visiting the border, President Donald Trump said he was directing federal agencies to begin reuniting children and parents, a first step to implementing his executive order reversing a policy that had drawn global condemnation.

Facing intense pressure, Mr Trump signed an executive order on Wednesday to stop the separations and keep families together during immigration proceedings. The order still faces possible legal challenges and administration lawyers were expected to file a request as early as Thursday to modify a 1997 court settlement that limits the government's detention of minors to 20 days.

Mr Trump's order, an unusual reversal by him, moves parents with children to the front of the line for immigration proceedings, but it does not end a 10-week-old “zero tolerance” policy that calls for prosecution of immigrants crossing the border illegally under the country's criminal entry statute.

At the Upbring New Hope Children's Centre in McAllen, Ms Trump thanked the staff for their "hard work and compassion" and asked how she could help to bring families back together.

“I'm here to learn about your facility, in which I know you house children on a long-term basis, and also like to ask you how I can help these children to reunite with their families as quickly as possible,” Ms Trump said.

Jeff Sessions says US border control detention centers not comparable to Nazi concentration camps: 'Jews were trying to leave the country'

The first lady asked how often the children get to speak to their parents ot families, and what physical and mental state the children are in when they arrive.

“Usually when they get here they're very distraught,” one official at the centre said. “When they see the environment,” the official added, the children usually settle down.

“First Lady Melania Trump has arrived in Texas to take part in briefings and tours at a no-profit social services centre for children who have entered the United States illegally and a customs and border patrol processing centre,” Ms Trump's office said in a statement. “Her goals are to thank law enforcement and social services providers for their hard work, lend support and hear more on how the administration can build upon the already existing efforts to reunite children with their families.”

Undocumented immigration across the US-Mexico border Show all 14 1 /14 Undocumented immigration across the US-Mexico border Undocumented immigration across the US-Mexico border Immigrant children, many of whom are separated form their parents, are housed in Texas' tent city Reuters Undocumented immigration across the US-Mexico border A two-year-old Honduran asylum seeker cries as her mother is searched and detained near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Undocumented migrants ride on the top of a freight train referred to as the beast, or La Bestia Getty Undocumented immigration across the US-Mexico border A cage inside a US Customs and Border Protection detention facility in Texas Reuters Undocumented immigration across the US-Mexico border US Border Patrol Academy All new agents must complete a months-long training course at the New Mexico facility before assuming their posts at Border Patrol stations, mostly along the US-Mexico border Getty Undocumented immigration across the US-Mexico border US-Mexico border fence A group of young men walk along the Mexican side of the US-Mexico border fence in a remote area of the Sonoran Desert Getty Undocumented immigration across the US-Mexico border US-Mexico border fence in the US Man looks through US-Mexico border fence into the US in Tijuana, Mexico Getty Undocumented immigration across the US-Mexico border US-Mexico border fence US Border Patrol agent Sal De Leon stands near a section of the US-Mexico border fence while stopping on patrol on in La Joya, Texas Getty Undocumented immigration across the US-Mexico border US Border Patrol Academy US Border Patrol instructor yells at trainees after their initial arrival to the academy Getty Undocumented immigration across the US-Mexico border Memorial service in Guatemala Families attend a memorial service for two boys who were kidnapped and killed in San Juan Sacatepequez, Guatemala. Crime drives emigration from Guatemala to the United States, as families seek refuge from the danger Getty Undocumented immigration across the US-Mexico border Arrests on the border Undocumented immigrants comfort each other after being caught by Border Patrol agents near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Detention holding facility A boy from Honduras watches a movie at a detention facility run by the US Border Patrol Getty Undocumented immigration across the US-Mexico border Mexican farm workers Mexican migrant workers harvest organic parsley at Grant Family Farms in Wellington, Colorado Getty Undocumented immigration across the US-Mexico border Mexican family in Arizona A Mexican immigrant family sits in the living room of their rented home in Tuscon, Arizona. The family that Arizona's new tough immigrant law had created a climate of fear in the immigrant community. Getty

Ms Trump toured two facilities in the city that host 60 children, aged from five to 17 and mostly from Honduras and El Salvador. The shelter opened in 2014 in a facility that had been a vacant nursing home and assisted living facility.

“This was 100 percent [the first lady's] idea. She absolutely wanted to come,” Ms Trump's spokeswoman Stephanie Grisham said, adding that it was her idea before Mr Trump signed the executive order, and Ms Trump had no second thoughts after the order was signed. “She wants to see what’s happening for herself and she wants to lend her support, executive order or not. The executive order certainly is helping pave the way a little bit, but there’s still a lot to be done,” Ms Grisham said.

Ms Trump definitely wants to see children reunited with her families, with Ms Grisham saying she would. “do everything she can and she’ll speak her opinions as much as she can.”

When questioned on whether Ms Trump supports the “zero tolerance policy,” Ms Grisham said that "she supports that the law should be followed.”

The first lady had previously issued a rare statement over the weekend saying that she "hated" to see families separated.