BUENOS AIRES — President Trump hailed George H.W. Bush on Saturday as a “truly wonderful man” and announced plans to attend his Washington funeral, setting aside years of animosity with the Bush political dynasty that he toppled in his takeover of the Republican Party.

News of Bush’s death reached Trump during his visit to the Group of 20 summit here, and the 45th president quickly amended his schedule, calling off a planned news conference out of respect for the 41st president and designating Wednesday as a national day of mourning.

Despite deep acrimony between Trump and the Bush family, who represent divergent brands of Republicanism, Trump showered praise on Bush’s legacy as a World War II veteran and lifelong public servant, a résumé distinctly divergent from his own.

Trump said he spoke by phone with two of the late president’s sons, former president George W. Bush and former Florida governor Jeb Bush — who was among the GOP primary candidates Trump vanquished in 2016 — to express his “deepest sympathies.” Trump said they discussed the close bond between the sons and their father.

In Buenos Aires Dec. 1, President Trump and German Chancellor Angela Merkel spoke about the death of George H.W. Bush, the 41st president of the United States. (The Washington Post)

“President George H.W. Bush led a long, successful and beautiful life,” Trump wrote Saturday morning on Twitter. “Whenever I was with him I saw his absolute joy for life and true pride in his family. His accomplishments were great from beginning to end. He was a truly wonderful man and will be missed by all!”

Later Saturday, Trump told reporters that he “extended our best wishes” to the Bush family. Seated alongside German Chancellor Angela Merkel for a meeting, Trump called the late president “a very fine man.” Trump, who was set to return on Air Force One to Washington by early Sunday, said he plans to then dispatch the presidential plane to Houston to collect Bush’s casket and bring the former president’s body to Washington.

“I met him on a number of occasions,” Trump said. “He was a terrific guy and he’ll be missed. He lived a full life and an exemplary life.”

When a reporter shouted a question about whether he regrets his past criticisms of the Bushes — which included calling the U.S. invasion of Iraq during George W. Bush’s tenure “the single worst decision ever made” and referring to Jeb as “low-energy” during the campaign — Trump did not respond, saying only, “Thank you very much, everybody.”

Trump’s praise for the late president came amid an outpouring of respect for Bush from politicians on both sides of the aisle and in foreign capitals. In many ways, the two presidents were near opposites. Bush spent years serving in the military, federal government and elected office before winning the White House, and he was as finely mannered and courteous as Trump is bombastic and caustic.

The White House announced a state funeral was being prepared for Bush, and Trump’s decision, along with first lady Melania Trump, to attend raised the potentially awkward specter of the 45th president sitting alongside other political figures with whom he has feuded, such as former president Barack Obama, whom Trump has attacked repeatedly. In response, Obama has vigorously denounced Trump’s tactics and rhetoric on immigration, race relations and international affairs.

The White House also issued a presidential proclamation directing that the American flag be displayed at half-staff on all public buildings and grounds, at all military posts, U.S. embassies and consular offices around the world for the next 30 days.

Before a high-stakes working dinner with Chinese President Xi Jinping, Trump told reporters he would be returning to Washington shortly after the meeting to spend three days paying respects to Bush’s legacy, which included a stint as U.S. envoy to Beijing in 1974-75.

“We look forward to doing that and he certainly deserves it, he really does,” Trump said. “He’s a very special person.”

Trump did not attend the last major funeral in Washington — that of former senator John McCain of Arizona. The president had long feuded with McCain and denigrated his time as a prisoner of war in Vietnam, and the McCain family made clear he was not welcome at the services, which were attended by former presidents Obama, George W. Bush and Bill Clinton.

McCain’s memorial services — which culminated with a funeral at Washington National Cathedral attended by heads of state, military brass and other elites — amounted to an extraordinary repudiation of Trump’s presidency and a melancholy last hurrah for what many bemoaned had been lost in the Trump era.

It is unclear whether the funeral of Bush — who as a genteel, New England-bred patrician was more restrained in his criticism of Trump than the outspoken McCain — will carry the same tone, especially with Trump in attendance.

Trump also did not attend the funeral of former first lady Barbara Bush. Melania Trump attended that service in Houston, where she posed for a photograph along with George H.W. Bush, Obama, former first lady Michelle Obama, George W. Bush, former first lady Laura Bush, Clinton and former first lady Hillary Clinton.

Trump’s words of admiration for George H.W. Bush cap more than three years of hostility between the current president and the Bush family. During the 2016 Republican presidential primary, Trump delighted in prevailing over onetime presumed front-runner Jeb Bush, who had amassed a massive financial war chest and establishment endorsements but was quickly overshadowed by the business mogul and reality show star.

Yet his dismissive treatment of the family and disregard for political convention prompted George H.W. Bush, a lifelong Republican, to withhold his endorsement from the GOP nominee. Bush was reported to have voted for the Democratic nominee, Hillary Clinton, but a spokesman declined to confirm those reports.

Trump’s distaste for Bush’s style of politics dates back at least three decades. In 1990, as then-President Bush’s diplomacy was bringing a peaceful end to the Cold War, Trump, a Manhattan businessman with swaggering ambition, sat for an interview with Playboy. He was asked whether he thought Bush was too soft.

“I like George Bush very much and support him and always will,” Trump told the adult magazine. “But I disagree with him when he talks of a kinder, gentler America. I think if this country gets any kinder or gentler, it’s literally going to cease to exist. I think if we had people from the business community — the Carl Icahns, the Ross Perots — negotiating some of our foreign policy, we’d have respect around the world.”

In a statement issued early Saturday by the White House, Trump celebrated Bush’s achievements in public service, saying Bush “inspired generations of his fellow Americans to public service — to be, in his words, ‘a thousand points of light’ illuminating the greatness, hope, and opportunity of America to the world.”

That was a departure from Trump’s comments at a Montana rally this past summer, where he mocked the “thousand points of light” phrase that Bush had famously used to describe the volunteer spirit of Americans.

“You know all of the rhetoric: ‘Thousands points of light,’ ” Trump asked the Montana crowd. “What the hell was that? What does that mean? I know one thing: ‘Make America great again’ we understand. ‘Putting America First’ we understand. ‘Thousand points of light?’ I never got that one. What the hell is that? Has anyone figured that out?”

Trump’s mockery drew condemnation from the extended Bush political family. Ari Fleischer, a former White House press secretary for George W. Bush, tweeted: “This is so uncalled for. Going after a 94-year-old, former President’s promotion of volunteerism. I don’t mind potus being a fighter. I do mind him being rude.”

Bush restrained himself from entering the political fray with Trump and weighing in on the 45th president’s daily — and sometimes hourly — news cycles. But he made clear what he thought of Trump.

“I don’t like him,” Bush said in a May 2016 interview with Mark K. Updegrove in his book “The Last Republicans.” He added that he thought Trump was driven by “a certain ego.”

“I don’t know much about him, but I know he’s a blowhard,” Bush added. “And I’m not too excited about him being a leader.”