Sen. John McCain was laid to rest Sunday — on a grassy hill at the U.S. Naval Academy within view of the Severn River and earshot of midshipmen present and future, and alongside a lifelong friend.

McCain picked the historic site, not Arlington National Cemetery, where his father and grandfather, both admirals, were buried.

Years ago, Chuck Larson, an admiral himself and an ally throughout McCain’s life, reserved four plots at the cemetery — two for McCain and himself, and two for their wives, now widows. Larson died in 2014, and McCain wrote in a recent memoir that he wanted to be buried next to his friend, “near where it began.”

A horse-drawn caisson carrying the senator’s casket led a procession of mourners from the academy’s chapel to its cemetery following a private service. The senator’s widow, Cindy, and his children were among those who walked behind the caisson. Joining them were family and friends as well as members of McCain’s Class of 1958, military leaders and academy midshipmen.

Around 4 p.m., a flyover of military aircraft honored the Navy pilot who was shot down over Vietnam, and held more than five years as a prisoner of war. The burial was private as per the wishes of McCain, the Arizona Republican and 2008 presidential nominee who died Aug. 25 from brain cancer at age 81.

Vehicles that had carried mourners began leaving the area between 4:30 and 5 p.m.

One scheduled speaker at the service, Sen. Lindsey Graham, said before the service that he would tell the audience that “nobody loved a soldier more than John McCain, that I bear witness to his commitment to have their back, travel where they go, never let them be forgotten.”

Other scheduled speakers included David Petraeus, the retired general and former CIA director, and McCain’s son Jack.

As the hearse carrying McCain passed through a gate and into the academy, loud applause rang out from the several hundred people lining the street outside on the hot and muggy summer day. Many held their hands over their hearts and waved American flags. Some shouted, “God bless you.”

People in the crowd held signs that read: “Senator John McCain Thanks For Serving! Godspeed” and “Rest In Peace Maverick.”

Among the pallbearers on a list provided by McCain’s office were Frank Gamboa, his academy roommate; Defense Secretary Jim Mattis; and two men who were POWs with McCain in Vietnam, John Fer and Everett Alvarez Jr.

Tributes to McCain began Wednesday in Arizona and continued for the remainder of the week.

On Saturday, speeches by his daughter Meghan and two former presidents — Republican George W. Bush and Democrat Barack Obama — remembered McCain as a patriot who could bridge painful rivalries. While their remarks made clear their admiration for him, they also represented a repudiation of President Trump’s brand of tough-talking, divisive politics. Trump and McCain were at odds during the 2016 campaign, and for much of Trump’s presidency.

“There’s a lesson to be learned this week about John McCain,” said Graham, R-S.C.

“No. 1, Americans appreciate military service. ... If you work hard and do your homework and know what you’re talking about, people will listen to you. That if you pick big causes bigger than yourself, you’ll be remembered,” he told “Fox News Sunday.”

“He tried to drain the swamp before it was cool, that you can fight hard and still be respected. If you forgive, people appreciate it, and if you admit to mistakes, you look good as a stronger man. That’s the formula, John McCain. This was a civics lesson for anybody who wanted to listen. Why do we remember this man? Because of the way he conducted his public life.”

The Associated Press contributed to this report.