BALTIMORE — In a vast church sanctuary filled with powerful people, Elijah Eugene Cummings was remembered Friday as a man who strove to protect American democracy but still made time to cherish his daughters, attend 7:15 a.m. Sunday worship each week and stop on the side of the road to help a motorist change a tire.

For nearly four hours, 4,000 people, including two former U.S. presidents, mourned the longtime Democratic lawmaker, the son of sharecroppers who rose from South Baltimore to Congress.

“Elijah Cummings was a man of noble and good heart,” said former president Barack Obama, who sat in the front row of New Psalmist Baptist Church with Maya Rockeymoore Cummings, the congressman’s widow; Bill and Hillary Clinton; and former vice president Joe Biden, a 2020 presidential candidate. “And it now falls on us to continue his work.”

The service — sometimes joyous, sometimes solemn and sometimes funny — offered up a noble vision of public service, in which elected officials collaborate and compromise to serve the public good. With political figures of both parties in attendance, it was a far different atmosphere from the bitterly divided impeachment inquiry unfolding 50 miles away in Washington.

Obama, Hillary Clinton and Rockeymoore Cummings hinted at the contrast.

“This was a man of the utmost integrity! Do you hear me? He had integrity. And he cared about our democracy!” said Rockeymoore Cummings, the chair of the Maryland Democratic Party, her voice cracking slightly. “He wanted to make sure that we left a society worthy of our children.”

Maya Rockeymoore Cummings honored her husband Rep. Elijah E. Cummings (D-Md.) at his funeral Oct. 25 in Baltimore. (The Washington Post)

Addressing Hillary Clinton, a former secretary of state and the 2016 Democratic presidential nominee, Rockeymoore Cummings recalled that her husband used his leadership position to support the Obama administration during the Benghazi hearings.

“Oh my goodness. He spent many an hour defending you, against spurious claims,” Rockeymoore Cummings said.

When Democrats took control of the House last year, Cummings became chairman of the House Committee on Oversight and Reform “and now he had to go on to actually work to fight for the soul of our democracy against very real corruption,” she said.

As Oversight Committee chairman, Cummings spearheaded investigations into the Trump White House, vigorously opposed the separation of migrant children from their parents at the southern border and worked to keep a citizenship question off the 2020 Census.

While he maintained strong friendships with Republicans in Congress as well as with Democrats, he at times was targeted by the White House. This summer, President Trump attacked Cummings’s beloved Baltimore as a crime-plagued, “rat-infested” city, wondering why anyone would want to live there.

The remarks “hurt” Cummings, his widow told mourners Friday, and made the final months of his life more difficult.

Trump struck a different tone on Friday, speaking at a criminal justice reform forum in South Carolina before a predominantly African American audience.

“I want to extend my warmest condolences to the friends and family of Elijah Cummings, who are celebrating his life today in Baltimore,” he said, recalling conversations with Cummings about lowering the price of prescription drugs. “He had a very strong passion for that. We’re going to get it done. . . . I want to give my warmest respects, please.”

Hillary Clinton called Cummings “our Elijah,” and drew applause and cheers from the packed sanctuary when she made what appeared to be a biblically-themed jab at the current occupants of the White House.

“Like the prophet, our Elijah could call down fire from heaven. But he also prayed and worked for healing,” she said. “Like the prophet, he stood against the corrupt leadership of King Ahab and Queen Jezebel.”

Obama, the last politician to speak, pointed out the gigantic video screens flanking the stage, which heralded “The Honorable Elijah E. Cummings.”

“This is a title that we confer on all kinds of people who get elected to public office,” Obama said, drawing out some laughter. “But Elijah Cummings was honorable before he was elected to Congress. . . . As president, I could always count on Elijah being honorable and doing the right thing.”

Mourners began lining up at New Psalmist hours before the funeral and a viewing that preceded it. By 7 a.m., traffic was backed up a half-mile.

During the service, gospel singer BeBe Winans performed, and a parade of speakers — House Speaker Nancy Pelosi (D-Calif.), former congressman and former NAACP chief Kweisi Mfume, former staffer Jon Alexander, friends and mentors — honored all aspects of Cummings’s life.

Jennifer Cummings, 37, said her father was forever amazed that he could hold her in one hand when she was born. “This life, my life, in your hand,” she said.

Her father, she added, taught her the power of her “beauty and brilliance.” He wanted her to know her “rich brown skin was just as beautiful as alabaster, or any color of the rainbow” and insisted on buying her brown dolls to reinforce that message.

Adia Cummings, who spoke after her sister, asked members of her father’s congressional staff who were present to stand to be recognized. Dozens of people rose.

James Cummings, the congressman’s younger brother, revealed that the family called Elijah Cummings by the nickname “Bobby.” Mfume described a lifetime of civil rights activism and deep friendship. Alexander talked about his boss arriving late to vote on the House floor because he had stopped to help a driver in distress.

During his eulogy, Obama reminisced about the congressman’s “prophetic voice,” a deep baritone, which he said “just made you feel better.” And he told a story about Cummings’s father, who made his son shine his shoes and put on a tie and go to the airport — not to board a plane but to watch others who could afford to do so.

“I have not flied,” his father told him. “I may not fly. But you will fly one day.”

Sen. Elizabeth Warren (D-Mass.), like Biden a 2020 presidential contender; and Republican Reps. Louie Gohmert (Tex.), Jim Jordan (Ohio) and Mark Meadows (N.C.), as well as and Maryland Gov. Larry Hogan (R) were also among the thousands of attendees at the service, which Rockeymoore Cummings said her husband planned to the last detail.

She said he would have been far more pleased with the church-based “homegoing” than the tribute he received in Washington a day earlier, when he became the first African American lawmaker in history to lie in state at the U.S. Capitol.

Shortly before he died on Oct. 17 at age 68, Cummings’s caregivers rolled his hospital bed to the roof of Johns Hopkins Hospital so he could feel the sun on his skin, Rockeymoore Cummings said.

He looked out over the Inner Harbor, where during healthier times he had shared ice cream cones with his daughter Jennifer; to South Baltimore, where he grew up with his parents and six siblings; to West Baltimore, where he marched with a bullhorn and called for peace after Freddie Gray, a young, unarmed black man, died of injuries sustained in police custody.

Rockeymoore Cummings remembered her husband’s words: “Boy, have I come a long way.”

Colby Itkowitz in Washington contributed to this report.