McCain's body, which had lain in state at the US Capitol, arrived at the Washington National Cathedral after his procession first stopped at the Vietnam Veterans Memorial, where his wife, Cindy McCain, laid a wreath to honor those who died in the war.
Obama and Bush, a Democrat and a Republican, were joined by a who's who of US political leaders, Vietnam-era officials and dignitaries paying tribute to the statesman and former prisoner of war, who died Aug. 25 of brain cancer, days shy of his 82nd birthday..
President Donald Trump, who feuded publicly with McCain and criticized his war record, did not attend. Members of his administration, including his daughter Ivanka, son-in-law Jared Kushner, and national security adviser John Bolton were present.
McCain's family had made clear that Trump was not welcome at memorial services in Arizona and Washington or at Sunday's private burial service in Annapolis, Maryland, at the US Naval Academy. McCain was a member of the Academy's Class of 1958.
Trump spent the morning sending tweets about other subjects.
Inside the cathedral luminaries including comedian Jay Leno, former Secretary of State Madeleine Albright, former Senator Bob Dole and others visited with other leaders while a powerful pipe organ played music in the background.
McCain was a leading voice for revamping the country's immigration, campaign finance and environmental laws. But it was his military service, punctuated by years as a prisoner of war in North Vietnam, that molded McCain's political life.
McCain, who rose to the rank of captain in the US Navy, was shot down over Hanoi while on a bombing mission in 1967.
Held as a prisoner until 1973, McCain was tortured by his North Vietnamese captors in a jail that Americans dubbed the "Hanoi Hilton."