WASHINGTON — In a rare moment of national unity, President Trump, the four living former presidents, and national and global leaders gathered Wednesday at the National Cathedral to honor George H.W. Bush in a solemn but warm ceremony replete with pageantry, tears, and laughter.

The 41st president was remembered for his humility, global leadership, kindness, zest for life, and fumbling syntax.

Former President George W. Bush recalled his final conversation with his father: “The last words he would ever say on Earth were, ‘I love you, too.’”

And he recounted his father’s prayers for Robin, the daughter who died of leukemia at age 3.

“The best father a son or daughter could have,” Bush said, hunching over and, for a moment, choking on the words as he concluded his emotional tribute. “And in our grief, let us smile knowing that Dad is hugging Robin and holding Mom’s hand again.”

As he returned to his pew, Bush’s brother Jeb reached out and grasped his hand.

The state funeral in the soaring cathedral capped several days of mourning in Washington, as the capital’s political churn quieted for a moment and leaders in both parties came together in a show of respect. In the first pew opposite the family sat Trump and his wife, Melania, alongside Barack and Michelle Obama, Bill and Hillary Clinton, and Jimmy and Rosalynn Carter.

Although there was little interaction or warmth between the current president and his predecessors, most of whom he has criticized harshly, the Obamas and Trumps greeted one another politely, all four of them shaking hands. Hillary Clinton nodded toward Melania Trump.

George W. Bush greeted them all — and handed something to Michelle Obama, imitating a lighter moment from Sen. John McCain’s funeral in September, when Bush playfully sneaked a candy to the former first lady.

The national day of mourning brought lines of people to the cold streets in Washington, watching as the motorcade passed under low, gray skies. A military honor guard accompanied Bush’s flag-draped casket throughout the events, and, with most federal agencies closed, much of the capital stood still.

Memorials to Bush since his death Friday have evoked memories of a less divisive, less caustic era in politics. Several tributes to the 41st president centered on his decency and sense of duty, first manifested when he became a Navy aviator at 19 and was shot down during a World War II bombing run.

Historian Jon Meacham said Bush felt the “physical burden” of responsibility after he survived while two crewmates died.

“In a sense, the rest of his life was a perennial effort to prove himself worthy of his salvation on that distant morning. To him, his life was no longer his own,” said Meacham, who wrote a Bush biography.

The ceremonies honored the patriarch of a dynastic family that has left a deep imprint on American life. Bush, the son of a senator, spent nearly all his adult life in public service: a congressman, ambassador to the United Nations, CIA chief, and envoy to China before becoming vice president and president.

As president he presided over an international reordering, with the collapse of the Soviet Union and the fall of the Berlin Wall, but was defeated after one term as economic woes took hold at home. As often happens, he became more revered after leaving office, his more charming traits — like his habit of writing thank-you notes to anyone who helped him — overshadowing the flaws that hindered him while active in politics.

Meacham also recounted Bush’s foibles, drawing laughs and knowing nods from the former president’s children. He recalled how the comedian Dana Carvey once described his Bush impersonation as “Mr. Rogers trying to be John Wayne.” He also noted the hard-edged tactics Bush could use in politics, saying the president acknowledged that politics “isn’t a pure undertaking, not if you want to win.”

But he said Bush, though imperfect, ultimately showed deep care for others.

“A lion who not only led us, but who loved us,” Meacham said. “That’s why him. That’s why he was spared.”

George W. Bush described his father’s fondness for off-color jokes and his poor short game in golf, but also his love for his family, faith, and resiliency in the face of setbacks. He said he raced through golf rounds in order to get to the next thing, to enjoy as much of life as possible.

“He was no cynic, he looked for the good in each person, and he usually found it,” Bush said. “Dad taught us that public service is noble and necessary.”

Former Sen. Alan Simpson, a Wyoming Republican, described a selfless leader who knowingly absorbed a major political blow by agreeing to a bipartisan spending deal that broke his “no new taxes” pledge.

“Those that travel the high road of humility in Washington are not bothered by heavy traffic,” Simpson said in another tribute.

The funeral came just three months after a national outpouring for McCain, who died in August and whose services effectively morphed into a national rally for dignity, respect, and character — and an explicit rebuke of Trump. Many of those same themes have coursed through the remembrances honoring the elder Bush, but there were no direct critiques of Trump, no open hostility despite the president’s past attacks on Jeb and George W. Bush.

The president was invited to the funeral, after being excluded from McCain’s services, and in turn he praised the late president and extended hospitality to his family. The Bushes spent recent days at Blair House, the guest accommodations across from the White House.

“This is not a funeral, this is a day of celebration for a great man who has led a long and distinguished life,” Trump tweeted Wednesday morning.

Still, at times the contrasts between the late president and the White House’s current occupant were unavoidable. There were repeated tributes to humility and kindness. Former Canadian Prime Minister Brian Mulroney recalled Bush as a steady, unifying force in global affairs who declined to celebrate the fall of communism for fear of humiliating old rivals, and who brought countries together to fight the first Iraq War.

“When George Bush was president of the United States of America, every single head of government in the world knew that they were dealing with a gentleman, a genuine leader,” Mulroney said.

“Some have said in the last few days this is an end of an era,” the Rev. Russell Levenson Jr., rector of St. Martin’s Episcopal Church in Houston, said at the service. “But it does not have to be. Perhaps it’s an invitation to fill the hole that has been left behind.”

The day began with Bush’s casket being carried out of the Capitol by the honor guard, after he had lain in state beneath the building’s vast rotunda. A hearse drove the former president past the White House one last time, and after the funeral it passed the World War II memorial on the National Mall.

Bush’s casket then was flown to Houston, and on Thursday he was scheduled to be transported to his burial place at Texas A&M University in College Station, which hosts his presidential library. Bush’s body will make the roughly 70-mile trip on a train pulled by a locomotive called “Bush 4141,” unveiled in his honor in 2005 and painted to resemble Air Force One.

Crowds are expected to gather to see the train pass, echoing national funerals of years past. Bush’s burial is scheduled for Thursday afternoon.

Thousands visited the Capitol on Wednesday to pay tribute to Bush as he lay in state.

Lori Steele visited wearing a maroon-and-white Texas A&M scarf — her husband works as an administrator at the university. She said Bush embodied the core values listed in the school’s purpose statement: excellence, integrity, leadership, loyalty, respect, and selfless service.

“This is one president that held them all,” said Steele, 59, of Bowie, Md. She said she had been to several events attended by the former president and his late wife, Barbara. “He’s such a family man, you feel like you know him even if you don’t.”