McCain, who died August 25 aged 81 after a year-long struggle against brain cancer, was interred in a private ceremony in the academy's grassy cemetery overlooking the Severn River.
McCain, the son and grandson of four-star admirals, graduated from the naval academy in 1958.
Large crowds lined the road outside the cemetery to pay their respects as the funeral cortege carrying McCain's flag-draped casket passed by. Some saluted or held signs paying tribute. One woman shouted out, "God bless America!"
"I watched them lay my friend to rest today. I will miss him," Senator Jeff Flake tweeted Sunday along with a photo of him and McCain, in which the former pilot wore a Navy hat.
A day after a nationally televised memorial service at Washington's National Cathedral brought together a remarkable gathering of luminaries from both parties -- including three former presidents, but not the current one -- Sunday's ceremony was designed more as a family affair, including the military family to which McCain proudly belonged.
General David Petraeus, a McCain friend and onetime commander of the US Central Command, was to deliver a tribute.
Pallbearers included US defense secretary James Mattis; rear admiral and former naval academy superintendent Thomas Lynch; Admiral John Richardson; and two men -- Everett Alvarez Jr. and Jon Fer -- who were prisoners of war in Vietnam along with McCain.
Trump isolated in his silence on McCain
The senator was to be buried next to his best friend from Annapolis days, Chuck Larson, who died in 2014. Larson and McCain were roommates through navy flight school, and Larson went on to become the second-youngest admiral in navy history and an academy superintendent.
Thousands endure blazing Arizona heat to view Senator John McCain's casket
McCain, a lifelong rebel who graduated near the bottom of his class, had planned a military career. But after his fighter jet was shot down over Vietnam, leaving him with lifelong injuries, he ultimately left the military and turned to politics, representing Arizona in the US Congress for 35 years.
He ran unsuccessfully for president twice, in 2000 and 2008.
The week's memorials, planned mostly by McCain himself in his final year of life, often seemed crafted to draw a contrast between the senator and a man of very different temperament and values with whom he often feuded: Donald Trump.
US Senator John McCain, ex-POW and political maverick, dead at 81
The president, pointedly excluded from all the McCain events, had a difficult week.
He was widely criticized for keeping White House flags at half staff for only a day, and then reversed the order. A new Washington Post/ABC poll showed Trump's disapproval rating at an all-time high of 60 percent. And critics panned him for playing golf during Saturday's solemn event.
In Annapolis, Sam Smith, a 71-year-old retired federal employee, was among those saluting McCain's cortege as it passed.
"We just feel that he's somebody we admire," he told the Capital Gazette of Annapolis. "He was always a champion of the people."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ