President Donald Trump will visit Las Vegas on Wednesday to try to soothe a city shaken by the deadliest shooting spree in modern US history in a trip that will test his ability to console a grieving nation.

His trip to Las Vegas will be the first time he has had to deal directly with the tragic aftermath of deadly gun violence that has routinely claimed hundreds of lives in recent years.

‘It's a very horrible thing even to think about,’ Trump told reporters on Air Force One on Tuesday. ‘It's really horrible.’

Stephen Paddock, a 64-year-old retiree with no criminal record, was identified as the gunman in Sunday night's mass shooting, spraying bullets from the window of his 32nd-floor room at the Mandalay Bay hotel in Las Vegas.

Authorities said 59 people were killed and more than 500 injured from a crowd of thousands gathered to watch an outdoor country music festival. Paddock's motive remained a mystery.

‘He’s a sick man, a demented man. A lot of problems, I guess. We are looking into him very, very seriously. But we’re dealing with a very, very sick individual,’ Trump said of Paddock on Tuesday.

Trump has had mixed success in the traditional role of ‘consoler-in-chief.’ He inflamed racial tensions in the aftermath of a white-supremacist rally in Charlottesville, Virgina, and he has struggled to strike the right tone in responding to hurricane devastation in Puerto Rico.

Visiting Puerto Rico on Tuesday, Trump said jokingly that the recovery from Hurricane Maria there was blowing the US budget ‘a little out of whack.’ He spent most of his day meeting with people charged with responding to the crisis than with people affected by it.

The Las Vegas shooting has reignited a debate in Washington and across the country about whether more gun control legislation might have prevented what happened.

Republicans who control the US Congress have shown little inclination to respond to Democratic appeals for gun measures, although momentum appears to have slowed for legislation that would make it easier to buy gun silencers.

On the campaign trail last year, Trump aligned himself with gun rights advocates who consider the US Constitution's Second Amendment right to bear arms sacrosanct.

Asked on Tuesday whether it was time to debate gun control measures, Trump said: ‘Perhaps that will come. But that's not for now.’

Trump has responded to the Las Vegas massacre by holding a moment of silence on the White House South Lawn and ordering flags lowered to half-staff. He called the shootings ‘an act of pure evil.’

In Las Vegas, the president will grieve with friends and family of the victims, offer support for the wounded and thank first responders, the White House said.

Trump has some strong ties to the desert city. He helped build the luxury Trump International Hotel, where he stays when he visits, and was a frequent visitor during the presidential campaign last year.

He lost the state to Democrat Hillary Clinton in the November 2016 presidential election.