Democratic presidential candidate Kamala Harris said “We can't have open borders” as she continues to disassociate from her party’s calls for unrestricted immigration and tearing down existing barriers at the U.S.-Mexico border.

The U.S. senator from California, a leading 2020 hopeful for the White House on the Democratic side, has recently been overshadowed by the entry of Senate colleague Bernie Sanders -- the progressives’ likely first choice -- into the race, and the potential candidacy of Beto O’Rourke the former congressman from Texas who’s been making inroads and positioning himself as the anti-Trump candidate.

KAMALA HARRIS AFFIRMS SUPPORT FOR CAPITALISM AS DEMOCRATIC SOCIALIST SANDERS ENTERS RACE

This prompted Harris to come out against O’Rourke’s call to tear down the existing 700 miles of fencing on the U.S.-Mexico border during a Wednesday night appearance on Comedy Central's “The Daily Show.”

“No, I believe that we need border security,” said Harris, who has opposed President Trump’s immigration policies in the Senate.

“But we need smart border security. We can't have open borders, we need to have border security, all nations do,” she continued. “All nations define their borders, but we should not have a policy and perspective that is grounded in keeping people out for the sake of this nationalistic kind of thing this president is trying to push.”

"But we need smart border security. We can't have open borders, we need to have border security, all nations do." — U.S. Sen. Kamala Harris, D-Calif.

The rebuke comes after O’Rourke told MSNBC last week that would “absolutely” tear down the border wall in El Paso, Texas, if he gets the chance.

“Absolutely, I'd take the wall down,” O'Rouke said. “Here's what we know: After the Secure Fence Act, we have built 600 miles of wall and fencing on a 2,000 mile border. What that has done is not in any demonstrable way made us safer.”

KAMALA HARRIS' DAD SAYS PARENTS ARE 'TURNING IN THEIR GRAVE' OVER HER COMMENTS ON WEED AND BEING JAMAICAN: REPORT

Harris added during her TV appearance that although she wants a secure border, people should be allowed to come in. She also reiterated that the U.S. is “a nation that was founded and has grown because we have always welcomed immigrants.”

Harris’ comments were carefully hedged while other Democrats running for president, such as U.S. Sen. Kirsten Gillibrand of New York, have openly endorsed ideas such as abolishing the U.S. Immigration and Customs Enforcement (ICE) agency.

But just last year, Harris told multiple news outlets that the U.S. “maybe” or “probably” should “start from scratch” on an immigration enforcement agency, echoing the concerns of the “Abolish ICE” movement.

CLICK HERE TO GET THE FOX NEWS APP

Harris’ distancing from the far-left of the party has been in motion for days. On Tuesday, she reaffirmed her commitment to capitalism instead of democratic socialism and reiterated what she said a day earlier: “I am not a democratic socialist.”

“I believe that capitalism has great strengths when it works for all people equally well," she said. "I do believe that we do need to recognize that over the last many decades the rules have been written in a way that has excluded working families and middle-class families, and we have to correct course."