In Accra, Ghana, at 11:40 p.m. on Aug. 27, 1963, William Edward Burghardt Du Bois quietly passed away in his sleep. So came to a close 95 remarkable years of life defined by an unflinching commitment to black freedom and the achievement of true democracy in the United States.

At the time of his death, few individuals, regardless of race, could rival the accomplishments of W.E.B. Du Bois.

He was the first African American to receive a Harvard doctorate. He authored 16 nonfiction works on the black experience, five novels, two autobiographies and countless articles and essays. His 1903 genre-defying book, “The Souls of Black Folk,” is considered an American classic. He co-founded the National Association for the Advancement of Colored People and shaped the course of the modern civil rights movement as editor of its journal, the Crisis. Scholar, activist, artist and much more, Du Bois remains a singular figure in American history.

Arguably the central thread of Du Bois’s life and work was an engagement with the potential of American democracy and the presence of the color line, what he prophesied in 1900 would be “the problem of the 20th century.” Du Bois was black, and proudly so. But he was also an American, and understood that the unique gifts of black folk sprung from their tortured experience in the United States.

In trying to wrestle with this enduring tension — what he would famously characterize as “double consciousness” — Du Bois sought to both comprehend and expose the nature of the American democratic experiment. He held an abiding faith in the idea of democracy, while also remaining fiercely critical of the ways in which it had been distorted and denied to African Americans and other oppressed people. In the age of Trump, Du Bois’s life offers a much-needed lesson in historical honesty, moral courage and democratic hope.

Du Bois received his first education in democracy in the quaint western Massachusetts town of Great Barrington, where he was born on Feb. 23, 1868. Attending meetings to fund his small high school, he learned that “the essence of the democratic process is free discussion.”

As a young thinker, Du Bois internalized an understanding of democracy as a model form of government based on the open exchange of ideas and consent by the governed. More broadly, Du Bois approached democracy as an ethos and way of life, an ongoing process of discovery, learning and self-realization. Key to this was the importance of developing an educated and self-conscious citizenry.

Du Bois’s experiences in the South during the late 19th century and early 20th century “nadir” of race relations were formative. In 1885, when he traveled to Tennessee to attend Fisk University, Du Bois recalled that he “came in contact for the first time with a sort of violence that I had never realized in New England.”

His faith in democracy and progress would be further ruptured during his time as a professor at Atlanta University, where he confronted white supremacy on a deeply personal level. After the April 23, 1899, lynching and burning of a black farmer, Sam Hose, just outside Atlanta, Du Bois planned to register his protest with the local newspaper like a good democratic citizen. When he learned that Hose’s charred knuckles were on display in a grocery store window, he somberly turned around and walked back to his office.

Du Bois realized that the conflict between race and democracy was not simply a Southern problem, but one central to the very idea of America. He studied history and sociology at Harvard and the University of Berlin in order to grasp the contradictory nature of the American democratic creed and develop a way to reconcile it through his prodigious intellectual talents. Du Bois’s doctoral dissertation and first book, “The Suppression of the African Slave Trade,” addressed a critical question: What happens when the nation, because of its investment in race, fails to practice its democratic ideals?

Du Bois recognized the historical fragility of American democracy. He understood how during moments of great social, political and economic stress, democracy could expand as well as retract based on the color line and the endurance of racism. Throughout the history of democracy in the United States, opportunity and repression went hand in hand.

A consistent theme in his writings about key watershed periods such as Reconstruction, World War I, the Great Depression and World War II was how the tremendous potential of American democracy was repeatedly thwarted by the nation’s commitment to white supremacy and the interests of the powerful over the rights of the least fortunate. “Democracy has failed because so many fear it,” Du Bois declared in 1945. “So the world stews in blood, hunger and shame.”

By the 1950s, having lived more than three-quarters of a century, Du Bois had every reason to be pessimistic about the prospects of American democracy. He gravitated toward Marxism as a possible alternative, which led to his estrangement from the mainstream civil rights movement and ensnarement in the web of McCarthyism. In 1951, at the age of 83, Du Bois was indicted and tried by the federal government as a foreign agent.

The case was ultimately dismissed, but the sting of persecution from his own government for exercising his democratic rights remained. He refused to vote in the 1956 presidential election, believing that both political parties had failed the American people. He considered his decision one not of despair but of “dogged hope.” Only by protesting an unjust system and exposing the flaws of American democracy could it be saved.

Shortly before his death, Du Bois wrote, “I know the United States. It is my country and the land of my fathers. It is still a land of magnificent possibilities.” But he also accused the nation of “selling its birthright” and “betraying its mighty destiny.”

In 1961, as an act of defiance, Du Bois joined the Communist Party and left the United States for Ghana at the invitation of President Kwame Nkrumah. Africa, not America, would be his final resting place.

Du Bois would surely be disgusted by our current moment of democratic despair, a period of staggering ethical corruption, moral mendacity and political cruelty, with racism at its core. But he wouldn’t be the least bit surprised — and neither should we.

Donald Trump and what he has wrought are symptomatic of the deeper cancer of white supremacy that has been present in America since its founding. From the perspective of black folk, as Du Bois brilliantly and consistently demonstrated, democracy has always been in a state of crisis. Trump is both the mirror and our historical reckoning.

As each day seemingly marks the continued erosion of our democracy, it is easy to be disillusioned. Du Bois died disillusioned, exiled from the land of his birth and treated as a political pariah. However, he continued to believe not in systems and parties, but in people. And he always maintained his faith in black people to live, love and fight to make the democratic ideal of America a reality, a faith that inspires from the grave.

So it was fitting that on Aug. 28, 1963, just hours after Du Bois’s passing, some 250,000 people gathered on the Mall for the March on Washington for Jobs and Freedom. In his remarks to the crowd announcing Du Bois’s death, NAACP Executive Secretary Roy Wilkins said, “It is incontrovertible that at the dawn of the 20th century his was the voice that was calling to you to gather here today in this cause.”

In today’s 21st-century struggle for democracy, and at this present dangerous time, Du Bois’s voice continues to call to us. We ignore it at our own peril.