Donald Trump went on an extended diatribe about the lawmakers despite criticism from Democrats. (File)

US President Donald Trump stepped up his vilification of four liberal lawmakers as un-American at a raucous rally on Wednesday, underscoring that the attacks will form a key part of his strategy for winning re-election in 2020.

Despite criticism from Democrats that his comments about the four minority congresswomen are racist, Trump went on an extended diatribe about the lawmakers, saying they were welcome to leave the country if they did not like his policies on issues such as immigration and defending Israel.

"So these Congresswomen, their comments are helping to fuel the rise of a dangerous, militant hard left," the Republican president said to roars from the crowd in North Carolina, a state seen as key to his re-election.

Trump tweeted over the weekend that the four progressive representatives, known as "the squad" - Ilhan Omar of Minnesota, Alexandria Ocasio-Cortez of New York, Rashida Tlaib of Michigan and Ayanna Pressley of Massachusetts - should "go back" where they came from, even though all are US citizens and three are US-born.

The aim, one source close to Trump said, was to make Democrats look as far left as possible to moderate voters as he girds for a tough re-election battle in November 2020.

"He is trying to make them the face of the Democratic Party as we move closer into the 2020 cycle and he's trying to highlight them as a fringe crowd as much as possible so it turns off your middle-of-the-road voters," the source said.

As Trump recounted past comments by Omar, who was born in Somalia and emigrated to the United States as a child, the crowd began chanting: "Send her back!"

"Tonight I have a suggestion for the hate-filled extremists who are constantly trying to tear our country down. They never have anything good to say. That's why I say: 'Hey, if they don't like it, let them leave. Let them leave,'" Trump said.

Trump spent about a fifth of his freewheeling 90-minute-long speech criticizing the four lawmakers, to enthusiastic crowd response.

Former Vice President Joe Biden, the front-runner for the Democratic 2020 presidential nomination, weighed in against Trump's remarks via Twitter.

"These members of Congress - children of immigrants, just like so many of us - are an example of exactly what makes America great," Biden said on the social network.

Trump also derided Biden in his remarks and skewered other Democrats vying to be the party's 2020 candidate.

He repeated his frequent reference to US Senator Elizabeth Warren as "Pocahontas," a dig about a controversy over her heritage that Warren and Native American groups have complained is racist.

WINNING TACTIC?

Trump's Twitter attacks initially caused some heartburn for advisers who felt he had gone too far.

But two said Trump had since offered a contrasting view, that the political views of the four lawmakers were socialist, out of the mainstream and hateful to their home country, versus those of the president and his flag-waving rhetoric.

"If the American people have to choose between the squad and the president, then that's an easy decision," one adviser said.

Trump, who during his 2016 campaign voiced harsh assessments of the state of the country, tweeted a video ahead of the rally that featured patriotic scenes of the president meeting Americans, with frequent images of the American flag. It ended with the slogan: "America - One Squad Under God."

"Democrats are now the party of high taxes, high crime, open borders, late-term abortion, intolerance and division. The Republican Party is the party for all Americans and American values," he said in North Carolina.

The tactic follows a well-worn path for Trump, who called for a ban on Muslims entering the United States during his 2016 campaign. His proposal drew widespread criticism, but Republicans overwhelmingly supported it, and it was a factor in his victory.

Over the weekend, Trump inserted himself into what had been an internecine Democratic Party fight pitting Omar, Ocasio-Cortez, Tlaib and Pressley against House of Representatives Speaker Nancy Pelosi.

He first defended Pelosi, then attacked the four. That prompted Pelosi to defend her flock, prompting Trump and other Republicans to argue the Democratic Party had shifted to the left.

The Democratic-controlled House voted on Tuesday largely along party lines to formally condemn Trump's remarks as "racist."

Trump's attacks had a spur-of-the-moment quality around which the Republican Party later built a strategy.

The tactic had worked, said Barry Bennett, who advised Trump's 2016 campaign. "The Democratic Party last week was trying to distance itself from the squad, and this week they're hugging them, and that is a massive win for Trump."

But not all Republicans were comfortable.

"I'm disappointed in the tweets," said Steve Duprey, a member of the Republican National Committee from New Hampshire.

"I know the president is subject to lots of attacks, but he should always try to turn the other cheek and take the high road," Duprey said.