WASHINGTON — Massacres and natural disasters have a way of testing a president's humanity and poise. As he visits San Juan and Las Vegas in coming days — sites of enormous and very different tragedies — Donald Trump will face an onslaught of raw emotion that would challenge anyone.

In the last few days, Trump has displayed both a gentle and combative side that together paint a portrait of complexity for this consoler in chief.

On Monday, he sought to ease jitters after a night of carnage in Las Vegas that left at least 59 people dead, hundreds injured, and a nation numb with shock. He did so with solemnity, and earned high praise for a unifying message delivered in presidential style.

"We are joined together today in sadness and shock and grief," he said, speaking in somber tones at the White House. "It was an act of pure evil."

But over the weekend, he'd used the same bully pulpit to lambast a Puerto Rican mayor and other "politically motivated ingrates" who "want everything to be done for them" after Hurricane Maria.

For that, historians and critics knocked him for focusing on slights and grudges, for reacting defensively amid pleas from some Puerto Rican leaders to hasten the federal response as a humanitarian crisis looms — and from the comfort of his New Jersey golf resort.

The deadliest mass shooting in modern U.S. history came nine months into the Trump presidency, after a month of crises. A trio of hurricanes battered Texas, Florida and Puerto Rico, even as tensions with North Korea and major defeats on health care policy strained the administration.

On storm tours of Texas last month, Trump drew mixed reviews.

His first trip, to Corpus Christi and Austin, kept him far from storm victims. He met with first responders and state and local officials and climbed a firetruck to wave a Texas flag and promise Texans that Washington will help them rebuild. But his claim afterward that he'd seen "first hand" the horrors wrought by Hurricane Harvey fell flat.

Four days later in Houston — lesson learned — he hugged children, fed refugees at a shelter, met with and encouraged volunteers, loaded supplies in flood victims' cars, inspected devastated neighborhoods, and returned to the White House with glowing coverage.

1 / 4President Donald Trump and first lady Melania Trump stand during a moment of silence to remember the victims of the mass shooting in Las Vegas, on the South Lawn of the White House on Monday, Oct. 2, 2017. (Pablo Martinez Monsivais / AP) 2 / 4President Donald Trump holds the state flag of Texas outside of the Annaville Fire House after attending a briefing on Hurricane Harvey in Corpus Christi on August 29, 2017. President Donald Trump flew into storm-ravaged Texas in a show of solidarity and leadership in the face of the deadly devastation.(JIM WATSON / Getty Images) 3 / 4President Donald Trump met with people impacted by Hurricane Harvey at the NRG Center in Houston, Sept. 2, 2017. (Tom Brenner/The New York Times)(TOM BRENNER / NYT) 4 / 4President Donald Trump and Melania Trump meet people impacted by Hurricane Harvey during a visit to the NRG Center in Houston, Saturday, Sept. 2, 2017. (AP Photo/Susan Walsh)(Susan Walsh / AP)

Air Force One will leave Washington early Tuesday for the Caribbean. He'll visit Las Vegas the next day.

Aides likely will ensure that Trump interacts — and is seen doing so — with ordinary Puerto Ricans and, on Wednesday in Las Vegas, survivors of the massacre.

In both rhetoric and gesture on Monday, he signaled empathy for those affected by the mass shooting, and those simply shaken at the latest rampage. He offered a message of healing, and prayers of comfort for a scarred nation.

"Our unity cannot be shattered by evil. Our bonds cannot be broken by violence, and though we feel such great anger at the senseless murder of our fellow citizens, it is our love that defines us today, and always will, forever," he said in subdued tones from the Diplomatic Reception Room, beneath a portrait of George Washington.

"I know we are searching from some kind of meaning in the chaos," Trump said, noting that in such dark moments, answers do not come easily. "We pray for the entire nation to find unity and peace and we pray for the day when evil is banished, and the innocent are safe from hatred and from fear."

President Barack Obama used the aftermath of shooting rampages to rally public support for gun control measures; critics accused him of politicizing tragedy at such times. Trump resists such legislation. He ignored reporters' shouted questions Monday as to whether the latest rampage would prompt him to reconsider.

"We can have those policy conversations, but today is not that day," said press secretary Sarah Sanders, after choking up as she recounted acts of selflessness and heroism as the massacre unfolded.

The president announced that he'll spend Wednesday in Las Vegas, a city he knows well from his decades as a hotel magnate, and where his name is part of the gleaming skyline.

He spoke with the governor of Nevada, the mayor of Las Vegas, the sheriff of Clark County.

He ordered flags flown at half-staff through Friday.

He led a moment of silence on the South Lawn, with first lady Melania Trump and Vice President Mike Pence and his wife, Karen.

In times of heightened emotion, Trump has struggled at times for the right words to soothe the nation.

When neo-Nazis marched in Charlottesville, Va., Trump inflamed the situation by pointing to "many fine people" among the throngs wielding swastika flags and torches, chanting anti-Semitic and anti-immigrant slogans.

His message vacillated between one of condemnation of fascists and the neo-Nazi who murdered a counter-protester by plowing a car into a crowd, and defense of what he characterized as well-meaning defenders of Confederate heritage.

The more measured tone emerged when Trump was reading from a text that was crafted and vetted.

That combative side wasn't evident Monday. Instead, Trump, relying on written text that he read off a Teleprompter, spoke in a solemn cadence, in subdued tones. Even when he wasn't relying on a script, he stuck to a message that wasn't likely to offend.

"It's a very, very sad moment for me. For everybody," he said during an Oval Office meeting with the leader of Thailand's military junta, after his address to the nation. "This is a very, very sad day."