Drawing on the water pipe, Mr. Chpakov (pronounced SHPA-kov) explained that he is not, technically, a German rapper. Born in the Soviet city of Chernovtsy — once a center of Yiddish culture and now the Ukrainian city of Chernivtsi — in 1989, he came to Germany at 3 with his mother and grandmother. Being Soviet Jews, they were given refugee status as members of a persecuted religious minority.

Twenty-five years later, Mr. Chpakov remains a Ukrainian citizen. He grew up speaking Russian at home and attended synagogue regularly as a child. His early years were marked by poverty, and his stepfather was an abusive, drug-dealing Ukrainian army veteran who spent years in a German prison after convictions for assault and murder, Mr. Chpakov said.

Though he is not particularly religious, he said his Jewish identity has always played a role in his life. “I came to Germany with a whole community of people, all of whom knew who I was and where I came from,” he said. “It doesn’t matter if you’re observant or not. I learned as a kid my mother is Jewish, my grandmother is Jewish, my great-grandmother was Jewish — I’m Jewish by blood. I have no choice.”

As a teenager, Mr. Chpakov ran with a rough crowd, dealing marijuana and running petty scams on the streets of Osnabrück, his hometown north of the Ruhr Valley, where he still lives. After an arrest at 15 for theft and fraud, he was sentenced to 400 hours of community service at the city zoo. He dropped out of school not long afterward, working on construction crews while self-producing rap music under the jokey childhood nickname Sun Diego.

By 2011, he had built up a modest career as a rapper and producer — until fans turned on him for being too dance-club friendly. In 2013, he decided to reinvent himself. He donned a SpongeBob SquarePants costume he ordered on Amazon and entered rap battle competitions under the pseudonym SpongeBOZZ.

Delivering profane insults, violent threats and outrageous boasts while dressed as a children’s cartoon character turned out to be a perfect recipe for YouTube success. His videos were a sensation among young rap fans, and a 2015 album, “The Planktonweed Tapes,” briefly topped the German charts.

“He was trying to troll the whole game,” said Konstantin Novotny, a journalist who has written about Sun Diego’s recent popularity for the Jüdische Allgemeine, Germany’s Jewish newspaper. “A skinny guy in a costume, surrounded by insanely expensive cars, rapping about guns and drugs? It was a huge success with younger fans.”