BERLIN — When 24-year old W.E.B Du Bois arrived in Berlin in 1892, he’d never heard Wagner or Beethoven, ordered beer with kalbsbraten (roasted veal), or had a love affair with a German woman. He’d never studied the ties between politics and economics so closely, or been thrust into reconsidering his home country and identity so profoundly.

But in Germany, all of that would change.

“I found myself on the outside of the American world, looking in,” Du Bois wrote in his autobiography. “With me were white folk — students, acquaintances, teachers — who viewed the scene with me. They did not always pause to regard me as a curiosity, or something sub-human.”

Last month, on the 56th anniversary of Du Bois’s death, a group of activists, scholars, city officials and residents gathered in front of a new plaque that marks the location of Du Bois’ former residence in Berlin. The young Du Bois, still a student at Harvard at the time, would soon become a leading intellectual and civil rights activist for African Americans and the African diaspora.

Europe would transform his thinking, and he’d leave a legacy that profoundly influenced Europeans fighting racism.

“We all need models, we need people we can look up to,” said Maithy Moune, a managing director of Each One Teach One, an advocacy organization for black and African people living in Europe. “He was basically fighting for all of our rights, whether it be Americans, Germans or Europeans.”

But Du Bois’s reflection on their country also puzzled black Germans attending the ceremony. Many still don’t feel the level of acceptance that Du Bois described more than a century ago. Last weekend, the far-right party Alternative for Germany, or AfD — whose nationalist rhetoric and imagery frequently targets minority groups living in Germany — made significant electoral gains in regional elections.

That’s worrying to anti-racism activists who fear these political gains may be indicative of a broader trend toward a less tolerant society.

“In times like these, when migration and flight, or a diverse society are seen as a problem or as a crisis,” said Tahir Della, Speaker for the Initiative for Black People in Germany, “it is important to be clear on what kind of society we want as our reference point, and where we want to go.”

For the attendees of the ceremony honoring Dubois, his memory evoked comparisons to the types of discrimination faced by black Germans today.

“We are living in two worlds basically, being foreigners in our own country,” said Moune, who was born in Berlin. “I’m always being asked ‘how come you are speaking German so well?’”

“We’re experiencing racism every day,” she added.

For Du Bois, however, Europe in the late 19th century offered refuge from the United States, a place where he witnessed institutionalized segregation and violence against black people daily. Jim Crow laws brutally oppressed African Americans throughout the South. At the time, at least 100 black Americans were killed every year by lynching, according to the German Historical Museum.

Du Bois had escaped much of that brutality simply by being born in a relatively tolerant Massachusetts. But even in the North, color mattered.

“It is a peculiar sensation, this double-consciousness, this sense of always looking at one’s self through the eyes of others, ” he wrote years later in “The Souls of Black Folk.” “One ever feels his two-ness,––an American, a Negro; two souls, two thoughts, two reconciled strivings; two warring ideals in one dark body, whose dogged strength alone keeps it from being torn asunder.”

While in Europe, the 24-year-old Du Bois traveled extensively and felt a veil of separation between color lines lift.

“The unity beneath all life clutched me,” he wrote in his autobiography. “I felt myself standing, not against the world, but simply against American narrowness and color prejudice, with the greater, finer world at my back.”

That world included the brushstrokes of Rembrandt and Titian, the poetry of the German Romantics, the cathedrals of Venice and Rome.

“I saw in the arch and stone and steeple the history and striving of men and also their taste and expression,” Du Bois wrote. “Form, color, and words took new combinations and meanings.”

An ambitious and talented student at Harvard, Du Bois spoke several languages, including German. In 1892 he won a fellowship to attend the University of Berlin to complete graduate work. The United States was in the midst of post-Civil War reconstruction efforts, and Du Bois was fascinated by Germany’s first chancellor, Otto von Bismarck, who had united Germany’s separate states into a single nation just two decades earlier.

During the holidays a German family welcomed him into their home, and their daughter fell in love with Du Bois, and even proposed marriage.

“I became more human; learned the place in life of “Wine, Women, and Song,” he wrote in his autobiography. “I ceased to hate or suspect people simply because they belonged to one race or color.”

Part of the acceptance he found in Germany may be due to his privilege, according to Marianne Bechhaus-Gerst, a professor of African studies at the University of Cologne. “When confronted with a person of Du Bois’s standing, white people in Berlin acted differently,” she said.

But that didn’t mean racism didn’t exist in Germany and across the continent. Anti-Semitism was commonly taught at major universities, and Berlin had also been instrumental for ushering in a new era of heightened imperialism and brutality abroad. Just seven years before Du Bois arrived, Bismarck had organized the Berlin Conference of 1884-1885 and formalized Europe’s scramble for Africa.

In Europe’s universities, racist theories about “minor races” were being developed by scientists. The theories would travel to the United States and help justify Jim Crow laws. Those laws, in turn, were later studied by colonialists and the Nazis to implement and maintain the brutality of colonial rule and the Holocaust.

They also helped underpin the violence of the 20th century’s first genocide. In what is now Namibia, German troops shot, starved, and tortured tens of thousands of Herero and Nama people to death. Hundreds of thousands more died in the Maji Maji revolt in German East Africa, in present-day Tanzania.

At the time of his stay in Berlin, Du Bois could not recognize the structures and thinking underlying the violence.

“He was 24 and for him imperialism and colonialism was a sort of normality that he was working himself out of,” said Martin Klepper, a professor of American Studies at the Humboldt University in Berlin. “He came back to the states and then he became really much more critical than he had ever been of colonialism and imperialism and racism.”

In fact, after his return to the U.S., Du Bois vehemently denounced colonialism, and wrote extensively about what he saw as a common origin for the violence he saw at home and abroad. “The problem of the twentieth century is the problem of the color line — the relation of the darker to the lighter races of men in Asia and Africa, in America and the islands of the sea,” he wrote in “The Souls of Black Folk.”

For many Germans, the same can be said of the 21st century.

“We have a big problem in Germany that we are not really talking about black history, we are not really addressing the issues of racism, colonialism, and so on,” said the activist Moune.

Germany’s colonial history receives only a brief mention in most school curriculums, and discussions around discrimination against black Germans and other minorities have historically been overshadowed by the country’s reckoning with the Holocaust.

“But there was always systemic racism in Germany and it still is,” said Bechhaus-Gerst. “And it was always important for the self constructing an identity as a white society to have these ‘others,’ whether they are black people or whether they’re Muslim."