Many speakers at the ceremony suggested that even in death, McCain could serve as a role model for a politically fractured nation.
He has opted to send vice-president Mike Pence in his place.
"We had our disagreements and they were very strong disagreements", the president said.
Trump, who McCain pointedly declined to invite to the service, began the morning tweetstorm at 7:19 a.m., with a slap at the state of the news media just as Fox, CNN and MSNBC were beginning to roll out their wall-to-wall coverage of the day's events.
"It is only right that today, near the end of his long journey, John lies here, in this great hall, under this mighty dome, like other American heroes before him", said Senate Majority Leader Mitch McConnell. John McCain by lining the route from the Capitol to the North Phoenix Baptist Church.
McCain asked Obama, a Democrat, and George W. Bush, a Republican, to speak at his memorial service and they gave personal testimony that overcoming rivalries and partisan politics was not only possible but good for the country.More news: DPH Announces Second Human Case of West Nile Virus in Delaware
More news: At midday: S&P 500, Nasdaq hit record highs on Powell comments
More news: Red Bull deny approach to Alonso for 2019
The White House has pressured Canada to accept the preliminary agreement it struck with Mexico on Monday to update the trilateral trade deal.
At 9:19 a.m., as Jared Kushner and Ivanka Trump arrived at the National Cathedral, where they were greeted by longtime McCain pal Sen.
"Donald Trump's administration champions policies that are destroying our planet, destabilising global order, and reaching new political depths by appealing to racism, misogyny, xenophobia and hatred", the Facebook event reads.
The procession's pause at the Vietnam Veterans Memorial, where McCain's widow, Cindy, is expected to lay a wreath, will highlight McCain's military service and his more than five years as a prisoner of war.
Volunteer member of the advance team for President Trump blocks photojournalist's camera as he tried to take a photo of a protester during a campaign rally in Indiana.
One by one, McCain's family and then his friends and colleagues approached the coffin to say goodbye. And he only marked McCain's passing on August 25 with traditional presidential actions after he came under fire from the American Legion.
Trump also suggested he could take a heavier role in the Justice Department - comments that came hours after he told Bloomberg that Attorney General Jeff Sessions would remain in his job until after November's midterm elections.