His face was pale and gaunt, his legs were wrapped in a blanket, and his eyes never seemed to make contact with the family members huddled around him. But on Tuesday, Jimmy Carter was there, in the front row of a church in Atlanta, just a few feet from the coffin holding Rosalynn Carter, his wife of 77 years.

Mr. Carter, 99, was some 164 miles from his home in Plains, Ga., where he had been in hospice care since February. He was brought into the church in a wheelchair, as the crowd of mourners at the memorial service looked on, many of them catching their first glimpse of him in nine months.

That he would make such a trek in his condition was, to some, shocking — and, to his family, worrisome.

And yet, it was also very true to form: a display of the tenacity, bordering on stubbornness, that has been a defining characteristic of Mr. Carter, the longest-living president in U.S. history.

“Come hell or high water, Jimmy Carter was going to use his inner resources to be there,” the presidential historian Douglas Brinkley said, adding that the former president “has the most intense willpower of any person I’ve ever known.”

A strain of determination has always been core to Mr. Carter’s identity, particularly when it came to Mrs. Carter, who rebuffed him when he first asked to marry her. But it has also evolved into a quiet intensity that has propelled him — and at times dismayed his family and aides — as he has repeatedly defied illness and infirmity.

“He is a man of enormous stamina and strength and will,” the author Kai Bird, a Carter biographer, said on CNN, as the memorial service concluded on Tuesday.

In 2019, after a fall left Mr. Carter with a black eye and stitches, he soon showed up to help build houses in Nashville for Habitat for Humanity. “I had a No. 1 priority, and that was to come to Nashville to build houses,” Mr. Carter said at a gathering of volunteers, according to People magazine.

“One of the things Jesus taught was: If you have any talents, try to utilize them for the benefit of others,” Mr. Carter, then 95, told the magazine, which reported that he had 14 stitches on his head. “That’s what Rosa and I have both tried to do.”

Not long after that, he fractured his pelvis. He ignored pleas from his family and staff and showed up to teach Sunday school at Maranatha Baptist Church, carefully perching on a stool in front of the congregation to offer a simple sermon about being a kind and loving neighbor.

Afterward, he and Mrs. Carter stayed in their seats, as dozens of visitors from around the world lined up for pictures with them.

Mr. Carter has rarely been seen in public since he entered hospice care, and in May, the Carter Center announced that Mrs. Carter, a longtime advocate for greater access to mental health care, had dementia. She died on Nov. 19, at age 96.

Mr. Carter’s family expressed concerns that attending Tuesday’s service could be taxing for the former president. But they also recognized the importance of his presence at the church, where he joined some of his successors and every living presidential spouse.

“He has been this moral rock for so many people, but she really was that rock for him,” his grandson, Jason Carter, said. “He’s glad he’s not going to miss it, but we’re all worried about him.”

Mr. and Mrs. Carter’s daughter, Amy Carter, said at the service that her father was not able to speak to the attendees. So she read a love letter that he wrote to his wife while he served in the Navy more than seven decades ago.

“My darling, every time I have ever been away from you, I have been thrilled when I returned to discover just how wonderful you are,” Mr. Carter wrote in the letter. “While I’m away, I try to convince myself that you really are not, could not be, as sweet and beautiful as I remember. But when I see you, I fall in love with you all over again.”

“Does that seem strange to you?” he went on. “It doesn’t to me. Goodbye, darling. Until tomorrow, Jimmy.”

Peter Baker contributed reporting.