The late Sen. John McCain (R-Ariz.) took a parting shot at President Donald Trump, with a statement written before his death that was released Monday, knocking Trump’s populist rhetoric and divisive ideas.

“We weaken our greatness when we confuse our patriotism with rivalries that have sown resentment and hatred and violence in all the corners of the globe,” McCain, which was read by family spokesman Rick Davis. “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.”

McCain died Saturday at age 81.

Trump wasn’t the only focus of McCain’s statement, which was more optimistic in tone than the line referencing the current state of political affairs would lead you to believe. In the note, he thanks the American people “for the privilege of serving you and for the rewarding life that service in uniform and in public office has allowed me to lead.”

“I’ve tried to serve our country honorably,” McCain wrote. “I’ve made mistakes, but I hope my love for America will be weighed favorably against them. I’ve often observed that I am the luckiest person on Earth. I feel that way even now as I prepare for the end of my life. I’ve loved my life, all of it.”

He ended the statement by calling for unity.

“We have always had so much more in common with each other than in disagreement,” McCain wrote. “If only we remember that and give each other the benefit of the presumption that we all love our country, we’ll get through these challenging times. We will come through them stronger than before. We always do.”

A schedule for memorials and services celebrating McCain’s life can he found on his website.

Trump finally issued a statement Monday afternoon, two days after McCain’s death, tersely saying, “Despite our differences on policy and politics, I respect Sen. John McCain’s service to our country and, in his honor, have signed a proclamation to fly the flag of the United States at half-staff until the day of his interment.”

Aug. 27, 2018, 4:24 p.m.: This article has been updated.