Former Vice President Joe Biden on Thursday remembered late Sen. John McCain as a brother, saying that the two of them were “cockeyed optimists.”

Biden, attending a memorial service for McCain at a church in Phoenix, delivered a tearful speech, praising the longtime Republican lawmaker from Arizona for his fairness, honesty and respect.

“John believed in the American people,” Biden said. “Not just the preambles. He believed in the American people.”

Biden, vice president under Barack Obama, said he believed McCain's death had hit people so hard because of his deep belief in the soul of America.

Biden said that McCain, in his final statement before dying last Saturday, “left us pretty clear instructions.”

“Believe always in the promise and greatness in America because nothing is inevitable here,” Biden said, quoting McCain. “He wanted America to be reminded and to understand.”

Biden declared that McCain’s “legacy is going to continue to inspire generations.”

“John McCain’s impact on America is not over,” Biden said. “It is not hyperbole. It is not over. I don’t think it’s even close.”

Biden, who served with McCain in the Senate, said the two got to know each other while traveling overseas together. On those trips, they would talk about family, politics and international relations.

“John is going to take his rightful place in a long line of extraordinary leaders in this nation’s history, who in their own way stood for freedom and liberty,” Biden said. “I know John said he hoped to play a small part in that story.

"John, you did much more than that, my friend.”

McCain, who survived five years as a prisoner of war in Vietnam, served three decades in Congress and went on to become the Republican Party’s presidential nominee in 2008, died on Saturday at the age of 81.

In his last hours, McCain turned down further medical treatment.

McCain learned he had an aggressive form of brain cancer in July 2017. Doctors discovered the tumor during a medical procedure to remove a blood clot from above his left eye. He remained upbeat after the diagnosis, flying back to Washington days after surgery with a large scar visible above his left eye to participate in the Senate’s health care debate.

McCain suffered from the same type of cancer that had claimed friend Ted Kennedy and Beau Biden, the former vice president's son.

McCain had a complicated relationship with President Trump, who infamously attacked him during the GOP primaries leading up to the 2016 election. McCain, according to The New York Times, made clear to the White House that he did not want Trump to attend his funeral, and would prefer that Vice President Mike Pence be there.

Trump honored that request.

Biden, though, said that politics wasn’t what was most important to McCain, but rather the underlying values.

Biden said that the late senator “could not stand the abuse of power wherever he saw it, in whatever form, in whatever country.”

Biden said that McCain fought for civility between politicians on both sides of the aisle, even in times of disagreement.

“To paraphrase Shakespeare,” Biden concluded. “we shall not see his like again.”

McCain's body returned to the Washington, D.C. area for the final time Thursday evening, when Air Force Two landed at Joint Base Andrews in Maryland. Defense Secretary Jim Mattis and various members of Congress greeted McCain's wife, Cindy, and their children.

McCain will lie in state under the U.S. Capitol Rotunda Friday, when a ceremony and public visitation will be held. A formal funeral service will be held at Washington National Cathedral on Saturday and McCain will be buried at the U.S. Naval Academy in Annapolis, Md., on Sunday.

Fox News' Alex Pappas, Samuel Chamberlain and The Associated Press contributed to this report.