SURFSIDE, Fla. — President Biden on Thursday recalled the anguish of the hours after a car crash killed his first wife and infant daughter, and not knowing whether his two sons would survive — just as relatives now are desperately hoping their loved ones are still alive amid the rubble of a collapsed condo building.

“It just brought back so many, so many memories,” Biden said, his tone serious, his cadence slow. “It’s bad enough. It’s bad enough to lose somebody. But the hard part, the really hard part, is to not know whether they’re surviving or not, just not having any idea.”

Earlier in the day, Biden had placed his hand on the forearm of Gov. Ron DeSantis, a frequent critic and potential Republican challenger seated beside him at a crowded conference table.

“You know what’s good about this?” Biden asked the group of local officials assembled to brief him. “We’re letting the nation know we can cooperate.” He held DeSantis’s gaze and added, “When it’s really important.” DeSantis nodded.

President Biden spoke to reporters on July 1 after speaking with relatives of some of those missing in the building collapse in Surfside, Fla. (The Washington Post)

During his trip to a grief-stricken stretch of Florida beachfront on Thursday, Biden summoned two defining features of his political identity: empathy and bipartisanship.

The former has shown up often in Biden’s presidency so far — in his regular public mourning for those who have died of covid-19, his emotional phone call with the family of George Floyd, his comments after successive mass shootings. It is a testament to a country still reeling from a pandemic and reckoning on race, as it confronts a new outbreak of violent crime on Biden’s watch.

The latter — bipartisanship — has been in short supply. No Republicans voted for Biden’s sweeping pandemic relief package. Many continue to spread false claims about the legitimacy of his election. The infrastructure deal he carefully negotiated with Republicans nearly imploded last week, and it faces tall hurdles in the months ahead.

Here in Florida, last week’s condominium collapse has claimed the lives of at least 18 people and left 145 missing. Officials paused their search-and-rescue operations on Thursday due to structural concerns. Biden said investigators were still looking into what caused the collapse.

The visit in many ways marked a return of norms and expectations for a president in times of national crisis after the awkward and sometimes ham-handed responses of former president Donald Trump. Where Trump often kept his distance from suffering and seemed to prefer focusing on strength, Biden spent hours addressing the emotionally fraught tragedy on Thursday.

Biden’s meeting with family members was private, but he spoke about it later. He recounted trying to console a woman who had just lost her husband and young son and “didn’t know what to do.” Another family he’d met had lost cousins, brothers and sisters, he said, and was praying for a miracle.

Biden was peppered with “heart-wrenching questions,” he added, such as relatives asking how they could move toward closure if they could not have a burial.

Some in groups he met with wept. And at several points during the day, he mentioned the tragic family deaths he has endured in his own life.

“The whole nation is mourning with these families,” Biden said after spending nearly three hours with victims’ relatives. “They’re going through hell.” His voice broke at times as he related the conversations.

The meeting ran long in part because Biden said he wanted to “speak to every single person who wanted to speak to me.”

Biden has made overcoming grief and tragedy a central part of his political brand, often drawing on his personal experiences to try to forge a connection with Americans who have experienced individual tragedy — and, more generally, a nation gripped by several crises.

He has spoken openly about the death of his adult son, Beau, who died of brain cancer in 2015, and the loss of his first wife and infant daughter, who were killed in a car accident in 1972.

In a meeting with first responders on Thursday, Biden spoke about the emergency workers who helped him overcome brain aneurysms in 1988, and about those who pulled his sons to safety from the 1972 accident

“You saved my life,” Biden told them.

But the meeting with families was especially personal. Jacqueline Patoka, a close friend of a missing family, posted a video on Instagram of an emotional Biden addressing some of the group. The video was reported by the Associated Press.

The president recalled how people trying to be helpful would talk to him after the deaths of his family members. “It used to drive me crazy when [someone] would say, ‘I know how you feel,’ ” Biden said. “And you know they meant well, but I know they have no idea.”

Biden said the pain of losing a loved one “never goes away.” He talked about Beau as “a beautiful son who survived” the crash as a child but died of cancer as an adult, “literally in my arms.”

Biden, who has recounted thinking about suicide after the 1972 crash, said he understands the hopeless feeling of grief. “I’m sure you’d trade places with whomever you lost,” Biden said, but he urged the families to “never give up hope.” The person you love and lose remains part of you forever, Biden said, a refrain he has used before.

“You’re in my prayers,” he said as some in the crowd teared up.

The president, talking later to reporters, addressed the plight of the many people still waiting to learn the fate of loved ones, knowing that each passing day diminishes the likelihood of more survivors. The condo building collapsed in the predawn hours of June 24.

“They’re realistic,” Biden said of the families, while still clinging to hope.

Still, some residents near the building site were frustrated by the heightened security that comes with a presidential visit. Dee Jeronimides, 81, who lives a few doors down from the building, said she was tired of being questioned by officers whenever she left her apartment. “This is all political,” she said.

Biden spent much of the day meeting with people at a hotel just north of Surfside. Before heading back to Washington, he and first lady Jill Biden stopped by a photo wall honoring the victims.

On what was a solemn day, Biden also forged a rare moment of bipartisan connection with DeSantis, perhaps one of his more unlikely Republican partners. An ally of Trump, DeSantis has been a frequent Biden critic and he is seen widely in his party as a prospective presidential candidate, perhaps as soon as 2024, meaning he may run against Biden.

At a morning briefing in one of the hotel’s conference rooms, Biden sat between DeSantis and Miami-Dade County Mayor Daniella Levine Cava, a Democrat. The president lauded both of them as he spoke about the difficult healing process ahead.

“There’s going to be pain and anxiety and suffering and even a need for psychological help in the days and months that follow. And so, we’re not going anywhere,” Biden said.

Seated across the table were Florida’s Republican senators, Rick Scott and Marco Rubio. Rubio is up for reelection next year and Scott is coordinating GOP efforts to retake the Senate.

Both Levine Cava and DeSantis praised Biden’s response and the president spoke glowingly of DeSantis. DeSantis returned the compliment, telling Biden he “has been very supportive.”

“We’ve had no bureaucracy,” DeSantis said, speaking of the response from the federal government.

“I promise you, there will be none,” Biden said.

But beneath the bonhomie lay some political caution. DeSantis did not greet Biden on the tarmac when Air Force One arrived. And as the men interacted in front of cameras during their meeting, they wore serious expressions and the cooperative sentiments they voiced were limited strictly to the tragedy before them.

That underscored the potency of the photographs that can surface following natural and man-made disasters. In the wake of Hurricane Sandy in 2012, then-New Jersey Gov. Chris Christie faced a backlash from fellow Republicans after a handshake and shoulder tap from President Barack Obama, which Christie found himself insisting was not a “hug.”

But moments of national mourning can also be galvanizing moments for a president. In 1995, President Bill Clinton traveled to Oklahoma City to honor the 168 people killed in the bombing of a federal building, saying, “Let us say clearly, they served us well, and we are grateful.”

After the Sept. 11, 2001, terrorist attacks in New York City, President George W. Bush traveled to the disaster site in Manhattan and spoke through a bullhorn, but a rescue worker called out that he couldn’t hear the president speak.

“I can hear you!” Bush responded. “The rest of the world hears you! And the people who knocked these buildings down will hear all of us soon.”

Obama struck a deeply emotional chord in 2015 when he broke into a rendition of “Amazing Grace” at a eulogy after a mass shooting at a church in Charleston, S.C.

All three of those events, unlike the Florida tragedy, were caused by perpetrators who had intentionally spread death, giving Biden’s visit Thursday a somewhat different tone.

And presidential efforts at showing empathy do not always go well. In 2005, a photograph of Bush surveying the devastation of Hurricane Katrina from Air Force One, rather than the ground, became a potent symbol of what many saw as his detachment from the suffering.

Trump took a different approach during a presidency that valued strength and power over empathy and mourning. He faced criticism for casually tossing rolls of paper towels into a crowd during a 2017 visit to Puerto Rico after the island had been ravaged by Hurricane Maria.

Gearan reported from Washington. Tim Craig contributed to this report.