As a tumultuous summer that hastened the end of President Biden’s political career winds to a close, he has spent the past two weeks secluded in Southern California and at a home in Rehoboth Beach, Del., that has become his refuge from the pressures of the presidency.

But presidents are never truly off duty, a reality that became clear when Israel recovered the bodies of six hostages in southern Gaza on Saturday. The White House announced late that day that Hersh Goldberg-Polin, a dual Israeli American citizen, was among the dead, and Mr. Biden spoke to Mr. Goldberg-Polin’s parents on Sunday morning.

“I am devastated and outraged,” Mr. Biden said in a statement on Saturday offering his condolences. He added that he would continue to work “around the clock for a deal to secure the release of the remaining hostages.”

The president appeared to be working behind the scenes throughout last week. He spoke with the prime minister of India last Monday and was spotted talking on the phone and reading papers on the beach. He briefly addressed reporters about the hostages after attending Mass on Saturday evening, but otherwise tried to stay out of the public eye, emerging only on Wednesday and Saturday for afternoons on the beach.

Some beachgoers, thrilled to find themselves on the same stretch of sand as the president, offered waves and greetings, but Mr. Biden, wearing red patterned swim shorts, a black cap and his signature aviators, turned his blue lounge chair around to avoid the onlookers — and at least one television camera. His wife, Jill, joined him both days.

The locals in Rehoboth Beach are largely protective of a president who has become a hometown fixture and did not blame him for keeping a low profile.