– When former Vice President Joe Biden traveled to Sen. John McCain’s ranch in Arizona last Sunday to spend a few hours with his ailing friend, the two reminisced about the “crazy senators” they had served with, the overseas trips they took together for decades and the friendship McCain forged with Biden’s two sons.

But the conversation on the sun-splashed deck off McCain’s bedroom was not all nostalgia.

“Here John knows he’s in a very, very, very precarious situation, and yet he’s still concerned about the state of the country,” Biden said. “We talked about how our international reputation is being damaged and we talked about the need for people to stand up and speak out.”

As he battles brain cancer and the debilitating side effects of his aggressive treatment, McCain himself is reckoning with his history and the future as he and a stream of friends share memories and say what needs to be said.

No one is saying goodbye, not explicitly. The son and grandson of admirals, McCain “doesn’t like overt sentimentality,” as his friend the former chief of staff Grant Woods put it. But his visitors are telling him they love him, how much he has meant to them — and together they are taking care of unfinished business.

The Republican senator encouraged the former Democratic vice president to “not walk away” from politics, as Biden put it before refusing to discuss a possible 2020 presidential run. McCain is using a new book and documentary to reveal his regret about not selecting former Sen. Joe Lieberman as his running mate in 2008. His intimates have informed the White House that their current plan for his funeral is for Vice President Mike Pence to attend the service to be held in Washington’s National Cathedral — but not President Donald Trump, with whom McCain has had a rocky relationship.

And some of his associates, though not his family, have started to quietly put out word that they want a “McCain person” eventually appointed to fill his Senate seat, a roster that includes his wife, Cindy.

John McCain, 81, is still in the fight, struggling with the grim diagnosis he received last summer: He has been leading conference calls with his staff in a strained voice, grinding out three-hour physical therapy sessions and rewarding himself most days with a tall glass of Absolut on ice.

But his health has become a matter of immediate political interest. McCain’s future may determine whether Republicans retain their single-seat Senate majority: Should the senator die or resign before the end of May, there will most likely be a special election for the seat this fall. But under Arizona law, if he remains in office into June, there will probably not be an election for the seat until 2020, which Republicans would prefer given Democratic enthusiasm this year.

The matter of succession for the McCain seat — a topic of such intense discussion that Republican officials here joke that Washington lawyers know Arizona election law better than any attorney in the state — is officially verboten among party officials and the senator’s friends. They are determined to reward him with the same good ending that his friend Sen. Ted Kennedy enjoyed before he succumbed to brain cancer in 2009.

McCain delights in sitting out on his deck where he once handled slabs of ribs on the grill, friends say. He and his wife listen to the hummingbirds and the burbling stream that runs through their 15-acre ranch, enjoy the verdant scenery in an otherwise arid region and divide their loyalties when the hawks start pestering Peanut, their Chihuahua mix. (Cindy McCain sides with their dog, John the hawks.)

“He finds real solace there,” Biden said.

A bout of diverticulitis temporarily landed McCain back in Phoenix’s Mayo Clinic last month. It caused him to miss seeing more than a hundred of his friends and colleagues, including the new secretary of state, Mike Pompeo, and Secretary of Defense Jim Mattis, who came to Arizona to attend the annual meeting of his foreign policy think tank, the McCain Institute.

Lieberman filled in for McCain at the forum and visited the senator afterward at the hospital, mixing talk of North Korea and Iran with well-worn jokes, like the one about the difference between a lawyer and a catfish. (One is a bottom-feeding scum-sucker; the other is a fish.)

“He was OK, but he wanted to get out of the hospital,” recalled Lieberman, one of McCain’s closest friends. “Look, this is a man whose whole life has been active.”

Having spent over two years in solitary confinement while he was imprisoned in Vietnam, McCain has no use for being alone, whether it is in the intensive care unit or at his ranch. And his deck is where he receives a constant flow of friends — with visits that often end with McCain saying, “I love you” — and takes calls on the iPhone he just swapped for his tattered flip phone. (McCain finally made the switch to download the Major League Baseball app to better follow his Arizona Diamondbacks.)

Biden and his wife, Jill, were there last weekend; Sen. Jeff Flake, R-Ariz., and his wife, Cheryl, visited Friday; other colleagues are set to come this week, and his seven children are there as often as they can be. The phone calls have been even more frequent: former President George W. Bush checked in last week, telling McCain the country is missing him.

In a visit on the deck earlier this year, Jeff Flake said he and McCain recalled how in the 1980s the legendary former Arizona congressman Morris Udall, a Democrat, had taken the newly elected McCain under his wing despite their differences in party.

“It was the two of us lamenting the loss of the politics of the past,” Flake said.

It was also at his Hidden Valley Ranch where the senator participated in a nearly two-hour HBO documentary and co-wrote what he acknowledges will be his last book, “The Restless Wave,” both of which are set to be released this month.

The film and the book amount to the senator’s final say on his career and a concluding argument for a brand of pro-free trade and pro-immigration Republicanism that, along with his calls for preserving the American-led international order, have grown out of fashion under Trump.

McCain on Trump

In the book, McCain scorns Trump’s seeming admiration for autocrats and disdain for refugees.

“He seems uninterested in the moral character of world leaders and their regimes,” he writes of the president. “The appearance of toughness or a reality show facsimile of toughness seems to matter more than any of our values. Flattery secures his friendship, criticism his enmity.”

Yet many in McCain’s own party believe that, by selecting Sarah Palin as his running mate in 2008, he bears at least a small measure of blame for unleashing the forces of grievance politics and nativism within the GOP.

While he continues to defend Palin’s performance, McCain uses the documentary and the book to unburden himself about not selecting Lieberman, a Democrat-turned-independent, as his running mate.

He recalls that his advisers warned him that picking a vice-presidential candidate who caucused with Democrats and supported abortion rights would divide Republicans and doom his chances.

“It was sound advice that I could reason for myself,” he writes. “But my gut told me to ignore it and I wish I had.”

Even more striking is how McCain expresses his sorrow in the documentary. He calls the decision not to pick Lieberman “another mistake that I made” in his political career.

Lieberman said he didn’t know McCain felt that regret until he watched the film. “It touched me greatly,” he said.

McCain has long been both a flawed politician and a larger figure of history, by virtue of his refusal to be released early from Vietnamese captivity. Former Sen. Bob Dole, for example, wore McCain’s POW bracelet while his future colleague was in the “Hanoi Hilton” prison camp.

Dole, now 94, said he planned to tell McCain in a coming phone call, “You’re a tough guy and you can overcome this.”

In Washington, McCain’s admirers believe the Senate and the GOP lack a needed counterbalance to Trump and worry that his absence only presages a larger decline in the country’s politics. With Kennedy gone and McCain ailing, Rep. John Lewis, D-Ga., the civil rights legend, is one of the few figures left in Washington who evoke a bigness at a moment in history that can seem all too small.

“The Senate is changing just like the country is changing,” said Sen. Lindsey Graham, R-S.C., who is McCain’s closest friend in the chamber. “But Washington now reflects what’s going on in the country, rather than leading it.”

Another McCain protégée, Sen. Amy Klobuchar, D-Minn., said she treasured how McCain treated her when they went on the congressional delegation trips he loves and foreign leaders would attempt to recognize the male lawmakers before her.

“They’d always look to Lindsey next,” Klobuchar said of the heads of state, referring to Graham, a frequent travel companion of McCain. “But he’d always say, ‘Senator Klobuchar is the Democratic lead and she’ll be going next.’ ”

McCain’s has been a lifetime of restlessness, beginning with the childhood relocations of his Navy family and evolving into unceasing demands of “what else?” aimed at his Senate staff. But the man whose political career took flight after he fended off charges of carpetbagging — by noting the longest he had lived in one place was as a prisoner of war — has found a measure of contentment on his ranch.

Biden said he was struck by how solicitous McCain was of him, inquiring about how he coped with the loss of his son Beau to brain cancer. Yet Biden said he was the one who hoped to impart a message.

“I wanted to let him know how much I love him and how much he matters to me and how much I admire his integrity and his courage,” Biden said.

Then he became more succinct. “I wanted to see my friend,” he said.