A video that emerged late Wednesday shows President Donald Trump boasting about the size of crowds at a rally while visiting hospital staff members and victims of the mass shooting in El Paso, Texas.

"That was some crowd," Trump said in the video from his visit. He went on to criticize Beto O'Rourke, the 2020 Democratic presidential candidate who used to represent El Paso in Congress. "And we had twice the number outside," Trump said. "And then you had this crazy Beto. Beto had 400 people in a parking lot."

Trump has been criticized for his response to the El Paso mass shooting, seeming to eschew the role of "consoler-in-chief."

Visit Business Insider's homepage for more stories.

During his visit to a hospital in El Paso, Texas, on Wednesday to meet with first responders, medics, and victims of Saturday's mass shooting, President Donald Trump bragged about the size of crowds at his recent rally in the city.

The moment, which was recorded in video broadcast by local news, indicates that politics and the campaign trail was not far from Trump's mind.

In the recording, filmed at University Medical Center of El Paso and published by CBS4, Trump was apparently addressing first responders and other hospital staff.

"They're talking about you all over the world. The job you've done is incredible," he said before beginning to talk about how many people attended a rally he held in the city in February.

"I was here three months ago, and we made a speech," Trump said. "What was the name of the arena? That place was packed."

He went on to insult Beto O'Rourke, the Democratic presidential candidate who previously represented El Paso in Congress and who held a counterrally there in February.

"That was some crowd," Trump said in the video. "And we had twice the number outside. And then you had this crazy Beto. Beto had 400 people in a parking lot."

The White House barred reporters from Trump's hospital visit, meaning information about what happened has emerged only in partial form.

Trump visited El Paso after the mass shooting in which 22 people were killed at a Walmart. The shooting is being investigated as domestic terrorism, with the gunman thought to have targeted Hispanics. O'Rourke has accused the president being a white nationalist who bore at least some responsibility with his hardline anti-immigrant rhetoric.

O'Rourke in a tweet Thursday responded to Trump's comments in the video.

On Monday, he condemned white nationalism and urged a new spirit of unity in a speech read from a teleprompter in the White House.

But Democrats and others have since criticized Trump over his response to the El Paso shooting as well as another hours later in Dayton, Ohio, in part because he attacked political opponents such as O'Rourke while touring the two places.

A video shared by Trump of his visit to the El Paso hospital has been likened to a campaign ad, with images of Trump being photographed with smiling hospital workers to a rousing soundtrack.

According to reports, most of the patients being treated for wounds after the shooting refused to meet with the president.

Trump has struggled with the "consoler-in-chief" role traditionally played by presidents after national tragedies, attracting criticism last year for selfies showing him grinning and giving a thumbs-up gesture in pictures with first responders to the Parkland, Florida, high-school shooting.

The president replicated the gesture in pictures with first responders and victims Wednesday.