Donald Trump used a visit to Las Vegas to express the sorrow and shock felt across the US in the wake of the deadliest mass shooting the country has seen in modern history, saying that “America is truly a nation in mourning”.

Having started the day by taking off from Washington by calling it "a very, very sad day for me, personally," the president ended it by striking a sombre and stately tone that sits in contrast to his visit to Puerto Rico the day before. It was on that trip he suggested the devastation wrought by Hurricane Maria had put the US budget “out of whack,”

Praising the bravery of first responders and seeking to comfort the families of victims during his final address of the day, Mr Trump said: “We know that your sorrow feels endless. We stand together to help you carry your pain... You’re not alone. We will never leave your side.”

The president — and First Lady Melania Trump — travelled to Las Vegas as investigators searched for the motive behind the attack, blamed on former accountant Stephen Paddock.

Paddock is said to have stockpiled dozens of weapons, using a number of rifles to rain bullets onto a crowd of country music festival patrons from the 32nd floor of his Mandalay Bay hotel suite. Fifty-eight people were killed, before Paddock turned a gun on himself, and hundreds more were injured. The FBI were questioning Marilou Danley, Paddock's girlfriend, on Wednesday night to see if she could provide any clues - but in a statement Ms Danley said she was "unaware" of any of his actions that led to the shooting.

The trip to Las Vegas provided another test of Mr Trump’s credentials as the nations comforter-in-chief after his visit to storm-battered San Juan.

After a day visiting victims and survivors, medical staff and first responders, Mr Trump finished with an address at the Las Vegas Police Department’s command centre, promising to stand by all those affected by the actions of a man he called “sick and demented”.

“We cannot be defined by the evil that threatens us or the violence that incites such terror,” he said. “We’re defined by our love, our caring, and our courage. In the darkest moments, what shines most brightly is the goodness that thrives in the hearts of our people.”

Returning to a theme that had run through his day, praising the “incredible bravery” of the medics, police, firefighters and civilians who had helped victims, Mr Trump said the “whole world” had seen what the best of what America had to offer.

“Words cannot describe the bravery that the whole world witnessed on Sunday night. Americans defied death and hatred with love and courage. When the the worst of humanity and strike it did the best of humanity responds,” he said.

Las Vegas shooting – in pictures Show all 15 1 /15 Las Vegas shooting – in pictures Las Vegas shooting – in pictures People scramble for shelter at the Route 91 Harvest country music festival after gun fire was heard Getty Las Vegas shooting – in pictures People carry a person at the Route 91 Harvest country music festival after shots were fired David Becker/Getty Las Vegas shooting – in pictures People run from the Route 91 Harvest country music festival after gun fire was heard David Becker/Getty Las Vegas shooting – in pictures A handout photo released via Twitter by Eiki Hrafnsson (@EirikurH) showing concertgoers running away from the scene (C) after shots range out at the Route 91 Harvest festival on Las Vegas Boulevard EPA/Eiki Hrafnsson Las Vegas shooting – in pictures People lie on the ground at the Route 91 Harvest country music festival after hearing gun fire Getty Las Vegas shooting – in pictures A man in a wheelchair is taken away from the Route 91 Harvest country music festival after hearing gun fire David Becker/Getty Las Vegas shooting – in pictures People stand on the street outside the Mandalay Bay hotel near the scene of the Route 91 Harvest festival on Las Vegas Boulevard EPA/Paul Buck Las Vegas shooting – in pictures FBI agents confer in front of the Tropicana hotel-casino after a mass shooting during a music festival on the Las Vegas Strip Reuters/Las Vegas Sun/Steve Marcus Las Vegas shooting – in pictures Las Vegas police run by a banner on the fence at the Route 91 Harvest country music festival grounds after shots were fired David Becker/Getty Las Vegas shooting – in pictures An injured person is tended to in the intersection of Tropicana Ave. and Las Vegas Boulevard after a mass shooting at a country music festival Ethan Miller/Getty Las Vegas shooting – in pictures Metro Police officers pass by the front of the Tropicana hotel-casino after a mass shooting at a music festival on the Las Vegas Strip Reuters/Las Vegas Sun/Steve Marcus Las Vegas shooting – in pictures A woman sits on a curb at the scene of a shooting outside of a music festival along the Las Vegas Strip AP/John Locher Las Vegas shooting – in pictures A cowboy hat lays in the street after shots were fired near a country music festival in Las Vegas Getty Las Vegas shooting – in pictures Las Vegas Metro Police and medical workers stage in the intersection of Tropicana Avenue and Las Vegas Boulevard South after a mass shooting at a music festival on the Las Vegas Strip Reuters/Las Vegas Sun/Steve Marcus Las Vegas shooting – in pictures Sheriff Joe Lombardo (2-R) speaking during a press briefing in the aftermath of the active shooter incident on Las Vegas Boulevard EPA

The president had started the day by travelling to the University Medical Center that had treated many victims. On the way, he passed the Mandalay Bay, holes still visible in the windows the gunman had shot from.

In the morning, authorities had opened the stretch of the Las Vegas strip passing by the casino and hotel. But police officers continued to block an approach road and hotel security was turning people way, while yellow police tape sealed off entrances.

That did not stop clusters of curious onlookers from gathering on the sidewalks encircling the casino. A truck slowed down so a man in the passenger seat could point his phone at the ornate fountain that sits outside the shining gold Mandalay. Across the street, towers of speakers marked the concert grounds where scores of people were slain.

When he reached the hospital, Mr Trump praised the “indescribable” job medics had done, and that many victims would be leaving in the coming in the coming days and weeks. He said he had met with some patients who were “very, very badly wounded, and they were badly wounded because they refused to leave… They wanted to help others”.

Donald Trump holds moment of silence for Las Vegas victims

Mr Trump has faced calls from some quarters - including many Democrats in Congress - to look at gun control legislation, but he deflected a question about gun violence at the hospital. “We are not going to talk about that today,” he said.

Later, at the police headquarters as groups of firefighters, paramedics and police officers trickled out after Mr Trump’s visit, state trooper Tom Vernon paused to say first responders ”appreciate [President Trump] coming in this horrible time“.

Asked whether the topic of gun control came up, Mr Vernon said ”this isn't the time for that“.

”It's time to heal, not worry about politics“, he said.

Elsewhere in the city, others were less pleased with Mr Trump’s visit, and his lack of willingness to engage in a debate about gun control.

“Unless he's giving blood I'm not welcoming him here”, said 45-year old Jason Engel, a Marine veteran outside one of the centres where civilians can give blood to help victims.

April Engel - Mr Engel's wife - said she was “not a fan” of the president, a feeling that was strengthened by Mr Trump not backing tighter gun restrictions over Paddock’s stockpiling of arms.