It was a dramatic turnaround for Trump, who has been insisting, wrongly, that his administration had no choice but to separate families apprehended at the border because of federal law and a court decision.
Obama has been the one of the primary targets of blame from Republicans for the crisis that exploded last week after it was announced about 2,000 children had been separated from adults as part of the Trump administration's "zero tolerance" policy.
Nielsen's action wouldn't end the zero tolerance policy, but would aim to keep families together and ask the Department of Defense to help house the detained families.
May said Wednesday that images of children in cages were "deeply disturbing".
Earlier Wednesday after a frenzied morning in which he huddled with Homeland Security Secretary Kirstjen Nielsen and other key officials, Trump first flagged his reversal saying, "I'll be doing something that's somewhat preemptive and ultimately will be matched by legislation I'm sure". But with Donald J. Trump, any impulse he has to exercise power can easily be overcome by his extreme reluctance to admit mistakes or back down even when his course of action has proved disastrous.
"This is a stopgap measure", said Gene Hamilton, counsel to the attorney general.
So Trump's order is likely to create a fresh set of problems and may well spark a new court fight.
"You've got to change the law", he said.
Hundreds of immigrant children have been flown to shelters in cities far from where their parents are held.More news: Police Make Arrest in XXXTentacion Murder
And it didn't do much for the teeming outrage over the issue.
If the president goes through with the signing, "It would be a complete 180". His message posted to Facebook was eloquent but unambiguous in its criticism.
First lady Melania Trump made a surprise trip to Texas to get a firsthand look at the crisis affecting children. Previous administrations accepted the unacceptable as long as the injustice was kept out of sight and out of mind, whether along the border or in family detention centres or in hidden ICE raids.
Homeland Security @SecNielsen did a fabulous job yesterday at the press conference explaining security at the border and for our country, while at the same time recommending changes to obsolete & nasty laws, which force family separation. Nielsen was heckled at a restaurant Tuesday evening and has faced protesters at her home. "They really would like to have open borders where anybody in the world can just flow in, including the Middle East", said Trump.
Following the meeting he tweeted: "Republicans want security".
But the executive order, a Health and Human Services official said, doesn't at all address reuniting families already separated.
Separating families fractures the most important social relations that human beings have.
Many of these "missing" children, however, may be with undocumented parents or relatives and now do not wish to be found by a government that they fear would deport them all. If those options are exhausted, authorities must find the "least restrictive" setting for the child who arrived without parents.
"Let's be clear: Donald Trump and the administration he runs have spent almost six weeks systematically ripping infants, toddlers, and children from the arms of asylum-seeking mothers and fathers fleeing violence and placing them in concentration camps and foster homes".