US president Donald Trump has travelled to Texas to push his immigration policies but turned first to mocking a former Democratic congressman now mulling a presidential run.

Beto O’Rourke held an evening march against Mr Trump’s wall with dozens of local civic, human rights and Hispanic groups, followed by a protest rally attended by thousands on a baseball field across street from the arena where Mr Trump was holding a rally in El Paso to make his case for the border wall.

Mocking Mr O’Rourke’s crowds as smaller than his, Mr Trump predicted: “That may be the end of his presidential bid.”

Trump
People cheer as President Donald Trump speaks at a rally at the El Paso County Coliseum (Eric Gay/AP)

The first duelling rallies of the 2020 election season were set to serve as a preview of a heated years-long fight over the direction of the country.

They made clear that Mr Trump’s long-promised border wall is sure to play an outsized role in the presidential race, as both sides use it to try to rally their supporters and highlight their contrasting approaches.

“With the eyes of the country upon us, all of us together are going to make our stand here in one of the safest cities in America,” Mr O’Rourke said as music and cheers from Mr Trump’s rally blared on to the field.

“Safe not because of walls but in spite of walls.”

A half-hour into his own rally, however, Mr Trump had scarcely mentioned immigration, offering just a passing suggestion that those chanting “Build the Wall” switch to “Finish the Wall”.

Meanwhile, negotiators on Capitol Hill announced that politicians had reached an agreement in principle to fund the US government ahead of a midnight Friday deadline to avoid another shutdown.

Mr Trump has insisted that large portions of the wall are already under way. But the work focuses almost entirely on replacing existing barriers.

Work on the first extension — 14 miles in Texas’ Rio Grande Valley — starts this month. The other 83 miles that his administration has awarded contracts for are replacement projects.

The Trump campaign released a video showing El Paso residents saying the wall helped reduce crime. But many in the city have bristled at the prospect of becoming a border wall poster child.

That includes Mr O’Rourke, a potential 2020 candidate, who came close to unseating Senator Ted Cruz in 2018 and maintains an army of small-dollar donors and a large social media following.

Trump O’Rourke
People attend an outdoor rally for Beto O’Rourke outside the El Paso County Coliseum where President Donald Trump was holding a rally (Rudy Gutierrez/AP)

While few Democratic candidates have focused on immigration in their launches, Mr O’Rourke has described Mr Trump’s calls for the wall as the “cynical rhetoric of war, of invasions, of fear”.

The El Paso rally is Mr Trump’s first since the November midterm elections and comes at a precarious moment for his presidency.

Weakened by the longest government shutdown in American history, Mr Trump is also contending with the ongoing investigation into Russian election meddling and a flurry of investigations by newly empowered majority Democrats in the House of Representatives.

Trump advisers have long insisted that, fulfilled or not, the wall is a winning issue for the president.

An AP-NORC poll conducted during last month’s shutdown found that more Americans oppose a wall than support it. But nearly eight in 10 Republicans are in favour, with only about one in 10 opposed.