The election of Ryyan Alshebl, a young man who fled Syria, offers surprising lessons for a Germany wrestling with its multicultural identity after an influx of refugees in 2015.The beer was flowing, the bratwurst were sizzling and the brass band at the village May Day festival led the crowd in ever tipsier renditions of the local drinking song.Clinking glasses all around was Ryyan Alshebl, a lanky, bearded 29-year-old from Syria.Eight years ago, Mr. Alshebl was part of the historic influx of refugees who crossed the Mediterranean Sea by dinghy and trekked the continent on foot, seeking asylum in Germany and other countries.Now he is the new mayor of Ostelsheim, a village of 2,700 people and tidily kept streets nestled in the rolling hills near the Black Forest in southwestern Germany.Ostelsheim appears to be the first German town to elect a mayor from the nearly one million Syrian refugees who reached the country in 2015, a wave that provoked a right-wing backlash and upended the political landscape. And the story of how this small, tight-knit village chose a refugee as mayor holds clues for a nation wrestling with an ever more multicultural identity.“If you look at our state elections, Ostelsheim is the kind of place that votes so conservatively. I thought it was going to be very, very tough for him,” said Yvonne Boeckh, a tax accountant, shouting over a rowdy polka number at the festival. “It’s just remarkable.”When Mr. Alshebl reached Germany with a college degree in banking, politics was hardly on his mind. Alone without his parents, who stayed behind in Syria, he threw himself into his new world and its traditions.Yet like many of the 2015 refugees, now gaining citizenship and building new lives, he never wanted to hide where he came from or apologize for it. And he rejected Germany’s old notions of integration.“Integration was a term that meant: We have a group of people that we need to find a way to teach some of the language and get them working,” he said. “And what kind of jobs? To work for the baker, the butcher, the shoemaker. But not to become mayor.”An aerial view of Ostelsheim, which dates to the fourth century and is nestled in rolling hills near the Black Forest.Ingmar Nolting for The New York TimesThe 2015 refugees were welcomed at first with an exuberant “Wilkommenskultur” — and former chancellor Angela Merkel’s famous line, “we can do it.” But wariness among parts of the population was leveraged by the far right, who became a force in German politics. That trend has regained momentum — even pushing mainstream politicians into harsher positions — as the numbers of people seeking asylum are again rising.A leader of Germany’s center-right Christian Democrats recently argued for removing Germany’s constitutional commitments to offer asylum. Today, over half of Germans polled believe the disadvantages of immigration outweigh advantages.Yet a majority of 2015 refugees have successfully found jobs and learned the language. And some have not simply integrated, but become leaders. For these newcomers, however, electoral success has been more elusive — even in large, multicultural cities like Berlin.Another Syrian refugee ran in the capital as a Green Party candidate for the federal parliament in the autumn of 2021. He faced death threats, was attacked at a subway stop and ultimately withdrew his candidacy.Mr. Alshebl, meeting with Franziska Binczik, the head of the kindergarten, in Althengstett, Germany, a village near Ostelsheim, in May.Ingmar Nolting for The New York TimesMr. Alshebl’s journey from Syria began in Sweida Province, where his middle-class family was passionate about politics, but kept their conversations secret. When President Bashar al-Assad’s authoritarian government drafted him into the army, he fled the country.Joining him was a friend, Ghaith Akel, a jovial tech engineer. The two 21-year-olds escaped to Turkey and spent eight nerve-racking hours on a rubber boat in the Mediterranean. They journeyed by train, bus and on foot across Europe to reach Germany.German officials sent the pair to the town of Althengstett, next door to Ostelsheim, in the rural Swabia region, where many people work in agriculture or the region’s famous auto industry. At first, they found the locals — mostly white Germans, with heavy regional dialects — daunting.“They put up boundaries,” Mr. Akel recalled. “You have to get past each and every one of those barriers to reach them. Anything new or strange, they find worrisome — ‘he’s not blonde, he doesn’t speak Swabian dialect.’”Eventually, they discovered the key to gaining acceptance by the community. They joined the local clubs.Mr. Alshebl volunteered at the recreation center. When a leadership position organizing games opened up, he ran. “People could have said, ‘No, we can’t have this Syrian guy who doesn’t know anything about this place,’” he said. “But they gave me a chance.”Ostelsheim’s town hall. Ingmar Nolting for The New York TimesThat experience rekindled his interest in politics. He vowed to perfect his German, enrolled in a vocational program for government administration and applied for an internship at the Althengstett town council. Eventually, the Althengstett mayor, Clemens Götz, hired him.Mr. Alshebl also learned to appreciate the local food.Ulrich Gellar, an Ostelsheim retiree, beamed at Mr. Alshebl’s enjoyment of spaetzle, a cheesy noodle dish, and maultaschen, the local dumplings. “And he drinks beer with us,” he said. “Little things like that have a big impact.”When Mr. Alshebl heard about Ostelsheim’s mayoral race last winter, Mr. Götz encouraged him to run.The main rival was a wealthy Ostelsheimer, with three children and a large family home.His friend, Mr. Akel, was nervous for him. “It’s a small village,’” he said, adding, “Their views on refugees are not always the nicest.”But Mr. Akel helped his friend campaign, with a simple strategy: Talk to everyone.Mr. Alshebl not only went door to door, he put up advertisements offering house calls on request.The May Day festivities were held at the local soccer club.Ingmar Nolting for The New York TimesSipping beers at the May Day celebration, locals recalled how intently he listened. Mothers unburdened complaints about day care shortages. Seniors were impressed by his familiarity with their retirement home grievances. For the first time since anyone could remember, a mayoral campaign energized the village.Not everyone was friendly. On local news websites, some readers posted comments asking how anyone could vote for a refugee. One family confronted Mr. Alshebl with news reports of refugees committing vandalism elsewhere in Germany. Others spread rumors he would impose Islamic sharia law.Friends in Ostelsheim urged Mr. Alshebl to advertise he was not Muslim; he is from Syria’s minority Druze sect. But he refused: “I didn’t want to stigmatize Muslims.” On election night, he won decisively — with his biggest support from Ostelsheim’s oldest, most conservative residents.Rainer Sixt, head of the band playing the May Day festival, insisted the surprise victory made sense. “The values in some places abroad, like tradition and home, are more like here in the countryside than in our own big cities,” he said.After the celebration, Mr. Alshebl visited his mentor, Mr. Götz. and his wife, Isabel. It was funny, they agreed, how long it has taken Germany to embrace an identity as a country of immigrants; since the 1950s, it has taken in Turkish guest workers, Balkan civil war refugees and Eastern Bloc exiles.A children’s soccer game at the local club, in May. Ingmar Nolting for The New York Times“This was long the reality in Germany,” Ms. Götz said. “Only now, the public finally became aware that Germany is not the same thing it was before.”Sipping his coffee, Mr. Alshebl grinned mischievously: “Or, at least, not since the election in Ostelsheim.”Mr. Alshebl, who officially starts his new job next month, now straddles two worlds — a comfortable one in Germany, and his family’s life in Syria, where they struggle to survive in a country ravaged by 12 years of war.“Everything OK?” he asked his mother recently, quickly picking up her call in his office.“We’re all fine — just waiting for the electricity, like always,” she said. Their diverging paths are palpable. Mr. Alshebl throws German words into the conversation, often oblivious to his family’s confusion.He compares his life to that of Syrian friends who have resettled in cosmopolitan German cities. There, they can create a small community, set up shops to buy familiar foods and speak Arabic together.But driving past Ostelsheim’s charming stone buildings, Mr. Alshebl mused that he was elected mayor not in spite of his l community — but because of it.“Maybe the only place you can become a mayor as a refugee is actually in a conservative country town,” he said. “Because to live here, you have to be a part of them.”“Maybe the only place you can become a mayor as a refugee is actually in a conservative country town,” Mr. Alshebl said. “Because to live here, you have to be a part of them.”Ingmar Nolting for The New York Times More