At the U.S. Naval Academy, John McCain and his Omaha buddy Chuck Larson were academic opposites — but they became lifelong friends and now will lie side by side.

In his final book, “The Restless Wave,” the legendary U.S. senator and former prisoner of war who died Saturday of brain cancer wrote touchingly of their joint final resting place. It’s at the U.S. Naval Academy cemetery along the Severn River in Annapolis, Maryland.

After enjoying a last look at the beauty around his home in Sedona, Arizona, McCain wrote, he would “take my leave, bound for a place near my old friend Chuck Larson on the Severn — back where it began.”

Retired four-star Adm. Charles R. Larson, a graduate of Omaha North High School who twice served as superintendent of the Naval Academy, died of leukemia at age 77 in 2014. McCain attended the funeral.

They first met as plebes in their freshman year at Annapolis and became roommates and, McCain often said, “the closest of friends.” At graduation in 1958, they couldn’t know what lay ahead.

“They both had storied careers of public service,” said Omaha City Councilman Pete Festersen, a nephew of Larson. “They had a very special connection that lasted a lifetime.”

In 1998, at a change-of-command ceremony when Larson retired as academy superintendent, McCain told the audience that they had graduated as Navy ensigns exactly 40 years earlier to the day.

“As brigade commander and president of our class,” McCain said, “Chuck was marked for greatness.”

As a top student, Larson received his diploma and a handshake from President Dwight Eisenhower. McCain graduated fifth from the bottom of the class.

McCain and Larson earned aviator wings by 1960, but Larson soon went into the submarine service. By 1969, the Omahan was serving as naval aide to President Richard Nixon.

By that time, McCain quipped, “I was on extended leave in Southeast Asia, having accomplished no greater feat than intercepting a surface-to-air missile with my airplane.”

McCain, the son and grandson of Navy admirals, spent 5½ years as America’s most famous prisoner of war. He was released with others in 1973.

Larson, at 43, became the second-youngest admiral in the history of the Navy. He later became commander in chief of all U.S. forces in the Pacific, the largest unified military command in the world.

Festersen — whose mother, Sigrid Festersen of Omaha, was the admiral’s sister — said he first met McCain at the 1998 retirement ceremony, two years before his first try at the presidency.

A Democrat, the Omaha councilman said he respected Republican McCain for many reasons, including his willingness to work with those across the political aisle.

“I was honored to have met him,” Festersen said. “He spoke his mind, and he always put country first. Sen. McCain was a national hero.”