President Donald Trump has visited the US-Mexico border and tried to credit his new wall with stopping both illegal immigration and the coronavirus.

But his visit played out as top public health officials in Washington were testifying about the ongoing threat posed by COVID-19, singling out Arizona as one of the states now experiencing a surge in cases.

In the blazing summer heat on Tuesday, Trump briefly stopped to inspect a new section of the concrete and steel structure where the president and other officials took a moment to scrawl their signatures on the wall.

“It stopped COVID, it stopped everything,” Trump said.

Trump was looking to regain campaign momentum after his weekend rally in Tulsa, Oklahoma, which was supposed to be a sign of the nation’s reopening and a show of political force but instead generated thousands of empty seats and swirling questions about the president’s campaign leadership and his case for another four years in office.

The low turnout sharpened the focus on Trump’s visit to Arizona, which doubles as both a 2020 battleground state and a surging coronavirus hot spot.

By visiting the border, Trump sought to change the subject to an issue he believes will help electrify his base in November.

“Our border has never been more secure,” Trump declared as he met with Republican Governor Doug Ducey and federal Border Patrol officials.

The visit came one day after the Trump administration announced that it was extending a ban on green cards issued outside the United States until the end of the year and adding many temporary work visas to the freeze, including those used heavily by technology companies and multinational corporations.

“Right now we want jobs going to Americans,” Trump said of the move.

Later Tuesday, he was to address a group of young Republicans at a Phoenix megachurch, where event organisers have pledged thousands will attend.