At special screening of a documentary about the senator’s life, Republicans and Democrats alike praised his legacy as formidable

John McCain might have objected to the occasion but he certainly would have been pleased by the attendance.

Dozens of senators from both parties attended a special screening of the forthcoming HBO documentary John McCain: For Whom the Bell Tolls at the US Capitol on Thursday. The 81-year-old Republican senator, who spent many of his more than 30 years in Congress forging friendships across the aisle, remained in Arizona, where he is battling brain cancer.

The Restless Wave review: John McCain on Trump, duty and Putin's 'evil' Read more

In his absence, they mingled over tacos, rice and beans at the reception before the screening. And between bites, his colleagues, friends and family reflected on his legacy, lionizing McCain as a “true American hero”, a “great human being” and a formidable rival.

“Each of us who’s served with John McCain can remember a time when he was our fiercest ally, and a time when he was our most maddening opponent,” the Senate majority leader, Mitch McConnell, said before the screening.

In the documentary, which takes its name from the Ernest Hemingway novel McCain calls his “lodestar”, the Arizona senator reckons with his record and his role in history. In what has become a passionate talking point for the senator, he laments the tribal politics that have produced a particularly unproductive and partisan era of governance and appeals for bipartisanship.

Facebook Twitter Pinterest John McCain is greeted by Richard Nixon in 1973, after spending more than five years in a Vietnamese prisoner of war camp. Photograph: HO/AP

“The reason our colleagues are here is because they respect John,” Lindsey Graham, a Republican senator from South Carolina and McCain’s closest friend in the chamber, said as he surveyed the auditorium filled with colleagues spanning the political spectrum.

“If you have not been on the other side of John, that means you didn’t do much in the Senate. So all of you are here understanding the good, the bad and the brilliance of John McCain.”

The film is, as Graham called it, a “warts-and-all” look at McCain’s extraordinary life, from the naval academy to Congress to Republican presidential nominee. The film looks at the major moments that have marked his life and political career.

“His story is a story of American heroism personified,” Senator Chuck Schumer, the Democratic minority leader, said of McCain, who was tortured during more than five years as a prisoner of war in Vietnam and yet refused early release in adherence with the POW code of honor.

When he thinks of his Republican colleague, Schumer said: “I think of his steadfastness, which could also be called stubbornness. His biting sense of humor, which could also be called cantankerousness. And I think of his principles, his unyielding faith in America’s values, which cannot be called any other thing.”

In a testament to his ability to forge relationships with members of the opposite party, the film features several interviews with Democrats, including Barack Obama, McCain’s rival in the 2008 presidential campaign; the former vice-president Joe Biden, a close friend; and the former secretaries of state Hillary Clinton and John Kerry. Despite tangling with McCain on the campaign trail, they all praised him as a consensus builder willing to put country over party. The former presidents Bill Clinton and George W Bush are also interviewed.

In the film, McCain recounts his biggest legislative fights over campaign finance, foreign policy and healthcare and his two presidential runs. It also discusses his role in the Keating Five affair, a banking scandal of the late 1980s that nearly derailed his political career. Even though it was determined McCain did not break any laws, he said the ruling that he had demonstrated “poor judgment” will always be a “black mark” on his record. And McCain recalls his regret during his 2000 presidential campaign not to call for the removal from the South Carolina state house of the Confederate battle flag. After his defeat, McCain apologized for what he called “a sacrifice of principle for personal ambition”.

Facebook Twitter Pinterest John McCain, then the Republican presidential candidate, at a 2008 campaign rally in Michigan. Photograph: Jim Young/Reuters

The documentary also explores the breakdown of McCain’s first marriage after his return from captivity. In an emotional interview, Carol McCain, the senator’s ex-wife, recalls being “heartbroken” when her husband left her and married Cindy McCain.

McCain has a large, blended family – two sons from his first wife’s former marriage, whom he adopted, a daughter from his first marriage, three children from his second marriage and an adopted daughter from Bangladesh.

Some of his family was in the audience for the screening, including his 106-year-old mother, Roberta McCain; his brother Joe McCain, his son, Doug; and other relatives.

Despite his illness, McCain has continued to raise his voice on issues that matter most to him. Earlier this month, he urged his colleagues to reject Gina Haspel, Trump’s nominee to lead the CIA, over her role in the agency’s past use of torture.

As guests filtered out of the auditorium after the screening, a handful of McCain’s friends and former staff members embraced, wiping tears from their eyes. The senators, meanwhile, hurried back to the chamber floor to confirm Haspel as the next director of the CIA.