US President Donald Trump has signed an executive order to halt family separations at the country’s southern border.

“We’re going to have strong, very strong borders, but we’re going to keep the families together,” Trump told reporters in the Oval Office of the White House on Wednesday in a surprising reversal of his immigration policy. “I didn’t like the sight or the feeling of families being separated.”

The US president, however, asserted that his “zero-tolerance” policy against illegal border crossing is still in place.

“You're going to have a lot of happy people,” Trump claimed.

A young girl holds a sign during a demonstration outside of the San Francisco office of the Immigration and Customs Enforcement (ICE) on June 19, 2018 in San Francisco, California.

Earlier this week, Homeland Security Secretary Kirstjen Nielsen accused the Republican-controlled Congress for creating the situation.

“Congress and the courts created this problem, and Congress alone can fix it,” she said.

The Wednesday reversal comes after days of news coverage featuring young children held in metal cages inside detention facilities near the US-Mexico border.

The Republican president has vowed to crack down on immigration but has failed to get his complete agenda through so far.

Since campaigning for the 2016 presidential election, Trump has been accused of stoking racial, ethnic and religious tensions lurking within America.

The latest move appears like an effort to calm down an international outcry over family separations at the border.