Mr. Clinton pointed to Mr. Cummings’s bipartisan friendships as proof of his commitment to a free and diverse society.

“No matter how hard he fought or how passionately he argued, he tried to treat everyone the way he wanted to be treated,” Mr. Clinton said. “The way he thought Americans should be treated. You can’t run a free society if you have to hate everybody you disagree with.”

In addition to Mr. and Mrs. Clinton, other prominent politicians who spoke at his funeral were former President Barack Obama, Speaker Nancy Pelosi and Elizabeth Warren, the Massachusetts senator and presidential candidate.

“Elijah wrote his funeral program and decided who he wanted to do what,” Bishop Walter Scott Thomas, the pastor, said after Ms. Warren and Representative Marcia Fudge, Democrat of Ohio, read from the Bible. “Some of you may be wondering why you are not doing anything, so I wanted to give you clarity.”

The funeral was held at New Psalmist Baptist Church in Baltimore, where Mr. Cummings could usually be seen seated in the front row on Sundays. The church seats 4,000 people, but was expected to draw far more for the funeral on Friday.

“I love this man,” Mr. Clinton said, gesturing toward the coffin. “I loved every minute I ever spent with him, every conversation I ever had with him. I loved his booming voice. But we should hear him now at the quiet times of night, when we get worried, and we get discouraged, and we don’t know if we can believe anymore.”

Again referring to the story of the prophet Elijah, Mr. Clinton said Americans should remember Mr. Cummings as “a still, small voice that keeps us going, keeps us grateful, keeps us happy and keeps us moving.”