In his final words to the nation before his passing, Sen. John McCain delivered a veiled rebuke of President Trump, calling on Americans to rally behind the country’s founding ideals rather than hiding behind walls and succumbing to political tribalism.

Rick Davis, a McCain family spokesman who was also the Arizona Republican’s campaign manager and longtime adviser, read the letter in full at an emotional news conference Monday at which he also outlined plans for funeral and memorial services in honor of McCain, who died at age 81 on Saturday.

“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,” McCain wrote in the letter. “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.”

Trump campaigned on a promise to build a wall across the U.S. border with Mexico and force Mexico to pay for it.

The extraordinary letter was a defiant coda to the years-long battle between the two men. Trump has said that McCain, who spent more than five years as a POW in Vietnam, was “not a war hero,” and continued to snub the longtime senator throughout his battle with brain cancer.

McCain, in turn, pulled no punches in criticizing the president on foreign policy and other issues, most recently in a stinging denunciation of Trump’s summit with Russian President Vladi­mir Putin in Helsinki last month.

Flags at the White House were lowered Saturday night in honor of McCain, but they were raised Monday morning despite the wishes of congressional leaders from both parties. For the second straight day, Trump remained silent about McCain: In three separate appearances at the White House, the president ignored questions from reporters about the late senator and his legacy.

Davis said Monday that Trump will not be attending the funeral or memorial services in Washington for McCain and that Vice President Pence will serve as the administration designee at a ceremony Friday at the U.S. Capitol Rotunda.

“The president will not be, as far as we know, attending the funeral. That’s just a fact,” Davis said, declining to reiterate what has already been reported about the McCain family’s wishes.

In response to another question, Davis told reporters that the family’s thoughts were solely on McCain.

“There really is no room in the McCain family to focus on anything but him,” Davis said.

On Saturday morning, a funeral procession for McCain will make its way from the U.S. Capitol along Pennsylvania Avenue toward Washington National Cathedral, with a brief stop at the Vietnam Veterans Memorial to lay a wreath.

Speakers at Saturday’s memorial service will include members of McCain’s family as well as former presidents George W. Bush and Barack Obama, former secretary of state Henry Kissinger, and former senator Joe Lieberman, one of McCain’s closest friends in the Senate, Davis said. The service will also include a performance of the Irish ballad “Danny Boy” by opera singer Renée Fleming.

Former vice president Joe Biden, McCain's longtime Senate colleague, is expected to speak at a separate service for the Arizona Republican in Phoenix on Thursday.

Arizona Gov. Doug Ducey (R) has said he will wait until after McCain's funeral Sunday to appoint a successor to serve out the remainder of the senator’s term through 2020. Davis did not weigh in at length Monday on the search for a successor, saying only that McCain probably would have wanted to see a Hispanic woman take his place.

McCain’s farewell statement did not mention Trump by name but refers at some length to the populist and protectionist forces that helped propel Trump to the office McCain twice failed to win.

“We are citizens of the world’s greatest republic, a nation of ideals, not blood and soil,” McCain wrote. “We are blessed and are a blessing to humanity when we uphold and advance those ideals at home and in the world.”

White supremacists who marched in Charlottesville last year chanted “blood and soil,” a translation of a Nazi slogan. Trump appeared to defend the rallygoers, who clashed with counterprotesters, when he said there were “fine people on both sides.”

McCain also defended the ideals of what came to be known as the liberal world order — the post-World War II architecture of American-led international institutions and alliances that Trump often complains have become a burden. McCain was also alarmed by the rise of far-right populism in Europe and the British break with the European Union that Trump has heralded.

“I lived and died a proud American. We have helped liberate more people from tyranny and poverty than ever before in history. We have acquired great wealth and power in the process,” McCain wrote.

He described the U.S. as a country comprised of “three-hundred-and-twenty-five million opinionated, vociferous individuals” who “argue and compete and sometimes even vilify each other in our raucous public debates.”

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

Gearan and Sonmez reported from Washington. John Wagner contributed to this report.