A German government official has advised Jewish people to avoid wearing yarmulkes in parts of the country amid rising incidents of anti-Semitism.

Felix Klein, the commissioner for the fight against anti-Semitism, was quoted in an interview with the Funke newspaper group on Saturday as saying that "my opinion has unfortunately changed compared with what it used to be" on the matter.

"I cannot recommend to Jews that they wear the skullcap at all times everywhere in Germany," Klein said, without elaborating on what places and times might be risky.

Israeli President Reuven Rivlin said Sunday that Klein's statement, which drew mixed reactions in Germany, "shocked me deeply."

He added: "We will never submit, will never lower our gaze and will never react to anti-Semitism with defeatism — and expect and demand our allies act in the same way."

The skullcap, also called a yarmulke or kippah, is a traditional Jewish head covering. There are around 100,000 Jews in Germany, and the vast majority are relatively secular and don’t outwardly display signs of their faith.

The symbol became the center of public awareness over the current hatred endured by some Jews when an Israeli Arab wore a kippah in Berlin recently as an experiment. Video of the man being subjected to verbal abuse and an attack by a teenage Syrian refugee spread quickly on social media.

The incident prompted several cities around Germany to host marches with participants of all religions wearing the head covering as a sign of solidarity.

But the number of attacks continue to climb. Government statistics released earlier this month showed that the number of anti-Semitic and anti-foreigner incidents rose in Germany last year, despite an overall drop in politically motivated crimes.

Anti-Semitic incidents rose 19.6% to 1,799 from 1,504 in 2017, with 69 classified as acts of violence, the report said. Of the total, 1,603 were committed by far-right perpetrators, while 102 and 52 respectively were listed as crimes committed on “foreign ideological” or “religious ideological” grounds.

At the ballot box, gains by far-right populists have also set off concerns. The anti-immigration Alternative for Germany (AfD) party won more than 5.8 million votes in parliamentary elections in September — or around 13 percent of the ballots cast.

Klein has previously accused the AfD of making anti-Semitic views "presentable" by challenging a longtime consensus about how to deal with the country's fascist past.

Interior Minister Horst Seehofer has also said that "almost 95 percent of anti-Semitic crimes in 2017 had a right-wing motive."

On Sunday, the head of the Central Council of Jews told the Die Welt newspaper that a societal shift away from anti-Semitism is needed.

"The aggressive political climate has an effect," Josef Schuster said. "Overall, I am not prone to dramatization, but the situation in general has worsened."

His comments followed an attack on a Jewish couple in the city of Hemmingen who had the doormat of their home set ablaze and the word "Jew" spraypainted in German across the front of the house.

Others were sharply critical of Klein's comment.

Michel Friedman, a former deputy leader of Germany's main Jewish group, said it was an admission of failure and that "the state must ensure that Jews can show themselves everywhere without fear."

Bavaria's state interior minister, Joachim Herrmann, said that wearing a skullcap is part of religious freedom. "Everyone can and should wear his skullcap wherever and whenever he wants," he said.

Anti-semitism has also reared its head in the United States.

In the aftermath of a second deadly U.S. synagogue shooting in six months, Jewish leaders around the world last month urged a "wake-up call" on the threat.