BERLIN — Prospective gun buyers in Germany would have to undergo background checks to ensure they have no ties to extremism and social media companies operating in the country would be required to report suspicious posts under a series of proposals advanced Wednesday by Chancellor Angela Merkel’s government.

The legislation comes amid a recent spike in far-right crime. In June, a conservative politician, whose name had appeared on a neo-Nazi hit list circulated online, was fatally shot in the head in what officials believe was the country’s first far-right political assassination since the Nazi era. And just three weeks ago, a right-wing gunman killed two people after attacking a synagogue in Halle on Yom Kippur.

“The threat from far-right extremism and far-right terrorism, and with them anti-Semitism, is high in Germany and we can’t stress it often enough,” Horst Seehofer, Germany’s interior minister, said at a news conference.

The bulk of far-right attacks in recent years have consisted of anti-Semitic crimes and hate crimes targeting foreigners and those who support them. The far right has scapegoated immigrants as dangerous and broken longstanding taboos about using language that echoes that of the Nazis. This has come despite more than a decade of German economic prosperity and the country’s persistent ranking as one of the safest in the world.