Days after an attacker driving an SUV killed five people at a Christmas market in eastern Germany, calls for solidarity have given way to political sniping, as questions grew Monday about the authorities’ inability to prevent the deaths.

The police are holding a Saudi refugee, a 50-year-old doctor, who they say carried out the attack. He had been living in Germany for nearly two decades.

Still, the killings, in the eastern city of Magdeburg, brought concerns about immigration and security back to the fore, with political leaders on Monday looking to position themselves on those hot-button issues ahead of snap elections scheduled for February.

Despite calls not to use the attack for political purposes, criticism of the German government — including from Elon Musk — has cropped up from all sides. The fallout looks likely to supercharge what was already shaping up to be a brief, intense campaign following the collapse of the government after Chancellor Olaf Scholz lost a confidence vote in parliament last week.

The hard-right Alternative for Germany party held a demonstration Monday in Magdeburg. Hundreds of people attended the event in the city center, chanting “If you don’t love Germany, leave it,” and “Deport!”

Before the demonstration, the party’s candidate for chancellor, Alice Weidel, made it clear that the event would also be used for political purposes.

“Magdeburg would not have been possible without uncontrolled immigration,” said Weidel, whose party has been polling in second place in recent months, behind the conservative Christian Democrats. She also called for “a restrictive migration policy and consistent deportations!”

Hundreds of others heeded the call of local civic organizations to turn out for a counter-demonstration calling for peace and solidarity with the victims, also held in the city center. Magdeburg police said both events remained peaceful.

The attacker in Magdeburg plowed an SUV into the city’s main Christmas market on Friday, killing a 9-year-old boy and four women, police said, and wounding more than 200 others. As more indications have emerged that authorities had been alerted to the erratic behavior of the suspect, demands have also increased for answers to why the warnings were not taken more seriously.

In the state of Saxony-Anhalt, of which Magdeburg is the capital, lawmakers called an emergency session Monday to examine those questions, as well as how, despite extensive security measures, the attack was possible. Members of the center-left Social Democrats, Scholz’s party, have said they will grill the state’s interior minister, Tamara Zieschang, a member of the Christian Democrats, who control Saxony-Anhalt. Each side has blamed the other for weaknesses in the system that led to the attack.

At the national level, Germany’s top security official, Nancy Faeser, who is also a Social Democrat, called for opposition parties to support bills proposed before the government collapsed, which she said would strengthen the federal police and allow for increased observation of foreigners in Germany.

“All of this proposed legislation could be passed if the conservatives and the Free Democrats would stop blocking,” Faeser said in an interview with Der Spiegel, a German newsmagazine, referring to rival parties.

But the Christian Democrats blamed Scholz and his party for what they saw as a decline in trust in the police over the three years he has been in office.

The Social Democrat-led government “has unfortunately contributed to sowing mistrust against our security forces instead of strengthening our officers,” Thorsten Frei, a Christian Democratic lawmaker, told the German newspaper Rheinische Post.

Security officials in Germany have acknowledged receiving alerts about the suspect before the market attack, including tipoffs from Saudi Arabia about his extreme views. The Federal Office for Migration and Refugees said it had also received a prior warning about the suspect, though it did not specify where the alert came from, and the German branch of the Atheist Refugee Relief, an activist organization, said that it had taken him to court in Cologne over what it called a “defamation campaign” involving “aggressive” accusations against the group.

Lars Castellucci, a Social Democrat and head of the internal affairs committee in the German parliament, said Monday that he would call security service chiefs to an extraordinary meeting next week to try to understand why the suspect, who has been identified only as Taleb A. in keeping with German privacy laws, was not under closer observation.

“He was in no way unknown to officials,” Castellucci said. “We have to minutely retrace why we were not vigilant enough.”

Marco Buschmann, a leader of the Free Democrats, which quit Scholz’s government last month, leading to its collapse, called for Germany’s security systems to be examined and reorganized. But he also appealed to political rivals not to use the attack to gain ground in the election campaign.

Musk, who has already provoked the ire of German leaders by wading into their country’s politics with social media posts, wrote another message hours after the attack, calling Scholz an “incompetent fool” who should resign immediately.

The remark was the latest in series of postings that the billionaire has made about Germany’s internal politics, including expressing support for the Alternative for Germany party.