Lawmakers past and present, a vice president and Hollywood stars honored John McCain at a memorial service Friday in the U.S. Capitol’s grand Rotunda where Speaker Paul D. Ryan called him “one of the bravest souls our nation has ever produced” and joked about the late senator’s sometimes salty talk.

“Today, our nation bows in grief,” said Ryan, who encouraged legislators and other Americans to embrace McCain’s patriotism and his tolerance — even zeal — for difficult, principled political debates.

“We have this beautiful thing, the chance to do for this man what he did for us,” Ryan said. “To stand up. To stand up and to embrace the cause of his life.”

McCain, a former Republican nominee for president and six-term senator from Arizona, died of brain cancer on Aug. 25. He was 81.

The 30-minute service for McCain followed a solemn moment on the Capitol’s east front, where an honor guard of soldiers, sailors, airmen and Marines carried McCain’s flag-draped casket up the steps in a heavy rain.

Inside the Capitol Rotunda, McCain’s body was laid on a catafalque — or wooden platform — first constructed to support the coffin of President Abraham Lincoln. The audience included McCain’s 106-year-old mother, Roberta, and other members of his family, as well as 40 members of the Senate, dozens from the House, former lawmakers and Vice President Pence.

Pence represented the Trump administration. McCain’s family did not invite President Trump, who had criticized McCain publicly even as the senator drew close to death.

“The president asked me to be here, on behalf of a grateful nation, to pay a debt of honor and respect,” Pence said. In his eulogy, Pence cited a Christian hymn called “Faith of Our Fathers,” from which McCain had taken the title of his memoir, “Faith of My Fathers.”

“The full stanza of that hymn reads: ‘Faith of our fathers, living still. In spite of dungeon, fire and sword. Oh, how our hearts beat high with joy, whenever we hear that glorious word,’ ” Pence said.

He referred to McCain’s 5½ years in captivity as a prisoner of war in North Vietnam, after McCain’s Navy bomber was shot down over Hanoi in October 1967. “John McCain held firm to that faith, the faith of his fathers, through dungeons, fire and sword,” Pence said.

At 1 p.m., at the conclusion of the Capitol service for McCain, the public was allowed in to file past McCain’s casket — beginning a viewing that lasted until 8 p.m. Hundreds stood in long lines outside the Capitol to pay their respects for a few minutes in the Rotunda. An honor guard of U.S. Capitol Police will stand vigil overnight.

In the Capitol service, McCain was lauded by Senate Majority Leader Mitch McConnell (R-Ky.), who began by joking that McCain was so stubborn that his Senate colleagues sometimes needed a support group.

“Half a world away, wearing our nation’s uniform, John McCain stood up for every value that this Capitol building represents,” McConnell said, referring to McCain’s service as a Navy pilot and his years as a POW. “Then, he brought that same patriotism inside its walls — to advocate for our service members, our veterans and our moral leadership in the world.”

“So it is only right that today, near the end of his long journey, John lies here,” McConnell said.

By 10 a.m. Friday, hours before doors opened for the public viewing, people had already begun to line up in the sweltering August heat.

Billy Endress, a 71-year-old Vietnam veteran from Clinton, N.J., was among those in line to say goodbye to McCain. He made the trip, despite recovering from cancer that ate away at his jaw and impaired his ability to eat. He was wearing a POW/MIA shirt, sitting in a folding chair, with jars of pureed food stockpiled for the wait.

“I’m here to pay respects to a hero,” Endress said.

“I’m a Vietnam veteran, and I got very lucky, unlike John McCain. I didn’t suffer” as he did, Endress said.

Rich Washburn, 73, a Navy veteran who served in Vietnam, took the train from his hometown north of Philadelphia.

“He had his own values, and he put other people first,” Washburn said of McCain. “After his military experience, a lot of guys would have quit, and rightly so. And he just kept going and gave 35 more years to his country.”

Inside the Capitol, McCain’s Senate colleagues shared memories of his years in the Senate.

“Today I’ll be remembering friendship,” said Sen. Patrick J. Leahy (D-Vt.). “We’d sometimes get into big arguments on the floor. Two minutes we’d be in the backroom with our arms round each other laughing our heads off.”

“I remember very much the day I said goodbye to him. It was very emotional,” Leahy said. “It was here. We met quietly, just the two of us. We knew he wasn’t coming back. We talked about old times.”

Ryan recalled the times he found himself “on the receiving end of John’s distinct brand of candor. . . . I remember thinking more than once, yeah, he really does talk like a sailor.”

The ceremony in the Capitol Rotunda concluded with a benediction by Barry C. Black, the Senate’s chaplain. He referred to a sermon from the Rev. Martin Luther King Jr., who spoke about harnessing the “drum-major instinct” in human nature — the ambition to succeed, to be first — and using it to lead others in righteous causes.

McCain, Black said, was “a drum major for courage, truth and justice.”

After the ceremony, a long crowd of invited mourners filed past the casket, including Defense Secretary Jim Mattis, Attorney General Jeff Sessions, Hollywood stars Warren Beatty and Annette Bening, White House Chief of Staff John F. Kelly and Sen. Jeff Flake (R) — Arizona’s other senator.

“I’ll be remembering John with great respect, great affection,” Mattis said as he left. “There are about a million memories.”

After the service, McCain’s widow, Cindy, and Sen. Lindsey O. Graham (R-S.C.) visited the late senator’s black-draped desk in the Senate chamber.

D.C. Fire officials assisted several people who waited in the sweltering heat outside the Capitol. 

By about 5 p.m., fire and EMS officials had made contact with at least 31 patients suffering from symptoms that included heat exhaustion and dehydration. Two people were taken to hospitals for treatment. 

Two Metrobuses served as cooling stations while members of the American Red Cross provided aid. The temperature and humidity combined to make it feel like the mid-90s Friday afternoon, according to the National Weather Service.

The ceremony Friday came after two days of tributes for McCain in Arizona. A memorial service will be held at Washington National Cathedral on Saturday, with eulogies from former presidents Barack Obama and George W. Bush. A private burial will take place on Sunday at the U.S. Naval Academy in Annapolis.

Seung Min Kim and Erica Werner contributed to this report.