U.S. Sen. Ted Cruz, R-Texas, said Tuesday that the election of a “far-left socialist” to the Mexican presidency underscores the need for President Donald Trump’s administration to secure the border and build a wall between the United States and its southern neighbor.

Cruz said Mexican President-elect Andrés Manuel López Obrador, 64, had been running on an “anti-American campaign for a long, long time.”

López Obrador earned more than 50 percent of the vote count Sunday, a landslide compared to Mexico’s historical election results. He ran on a populist agenda in which he promised to put Mexico’s interests ahead of those of foreign governments and investors, leading some to label the candidate as a socialist in the mold of other Latin American leaders.

While responding to an audience question at a campaign stop Tuesday in Waco, Cruz pondered the future of U.S.-Mexico relations if López Obrador, known as “AMLO” in Mexico, were to become the equivalent of former Cuban President Fidel Castro, Venezuelan strongman Nicolás Maduro or his predecessor, Hugo Chavez.

“It could really cause a problem in terms of our relationship with Mexico if he follows through on the anti-America rhetoric,” Cruz said. In addition to the wall, Cruz also repeated his call for the federal government to increase staffing and technology on the border with Mexico.

Cruz stressed, however, that he hoped López Obrador’s fiery rhetoric was limited to campaign-trail stumping and that it would not influence his foreign policy. But the senator said an area of highest concern was López Obrador’s take on immigration.

"One of the areas that could be particularly problematic is he urged Mexicans before the election, ‘Pack up and go up north to America.’ ... I’m running in the state of Texas. How would it work if I stood up and said, ‘Elect me and then get the hell out of Texas!’?" Cruz said. "What a profound statement of giving up on your country, telling your citizens, 'Flee our country because we’re not gonna solve the problem.'"

Claims that López Obrador called for mass migration to the United States during the campaign have been debunked. Instead, PolitiFact reported that López Obrador said his party would defend the rights of migrants who have, out of necessity, left their hometowns to find a better life in the United States.

“It is a human right that we are going to defend,” he said.

López Obrador, who ran unsuccessfully in 2006 and 2012, has reportedly taken a more moderate tone since his historic victory on Sunday, calling for friendship with the United States. Still, observers are waiting to see what happens during Mexico’s five-month-long transition period, during which the president-elect will likely lay out his policy proposals and Cabinet nominees — providing a better look into his administration's agenda.