Mr. Carter, who in March became the longest-living president in American history, has endured a series of health setbacks in recent months only to bounce back. He fell and broke a hip in May, requiring surgery, then fell again twice last month, once resulting in 14 stitches days after his 95th birthday and then a second time fracturing his pelvis.

But after his latest hospitalization, he again drove himself back into his active post-presidential life, showing up in Nashville to work on a Habitat for Humanity project just as he had done for years since leaving the White House. He sported a black eye and a head bandage but otherwise appeared undaunted by his physical challenges.

He returned to Maranatha Baptist Church in Plains, Ga., a week ago to teach Sunday school and ruminated about the possibility of death. Recalling a bout with cancer four years ago, he said he would be at peace at the end.

“I, obviously, prayed about it,” he said. “I didn’t ask God to let me live, but I just asked God to give me a proper attitude toward death. And I found that I was absolutely and completely at ease with death.”

Mr. Carter, the nation’s 39th president, served one term from 1977 to 1981, determined to restore trust in government after the Watergate and Vietnam eras. He brokered a landmark peace agreement between Israel and Egypt at Camp David and passed treaties handing over control of the Panama Canal to Panama. But economic woes and the Iran hostage crisis hurt him politically, and he lost re-election to Ronald Reagan.