"We weaken our greatness when we confuse our patriotism with tribal rivalries that have sown resentment and hatred and violence in all the corners of the globe," the letter, released by family spokesperson Rick Davis, said. "We weaken it when we hide behind walls rather than tear them down, when we doubt the power of our ideals rather than trust them to be the great force for change they have always been."
He called for unification of all Americans and pointed out that people usually have much more in common with each other than in disagreement. McCain said Americans can overcome difficulties only when they are together and never surrender.
"We never hide from history. We make history," the senator wrote in the farewell statement.
McCain was first elected to the US House of Representatives in 1982, and, after serving two terms, was elected to the US Senate in 1986. McCain ran as the Republican Party's presidential nominee in the 2008 US election against then-Senator Barack Obama, who won the vote.