A boy walks past graffiti on a playground that reads: "Kosta we are waiting for you" in Belgrade, Serbia, Saturday, May 6, 2023. Kosta Kecmanovic is a 13-year-old boy who on Wednesday used his father's guns to kill eight fellow students and a guard. [AP Photo]

Serbia's education minister submitted his resignation Sunday following two mass shootings, one of them at a primary school, that left 17 people dead, and the country's government urged citizens to turn in all their unregistered weapons or run the risk of a prison sentence.

Education Minister Branko Ruzic was the first Serbian official to resign over the shootings despite widespread calls for more senior officials to step down in the wake of the back-to-back bloodshed. Ruzic cited the "catastrophic tragedy that has engulfed our country" in explaining his decision.

Weekend funerals were held for the nine victims of the shootings at the school in Belgrade, Serbia's capital, on Wednesday and the eight people killed in a rural area south of the capital on Thursday night. The violence, which also wounded 21 people, has stunned and anguished the Balkan nation, which tops the European list of registered arms per capita but had its last mass shooting a decade ago.

Soon after the first attack, Ruzic was quick to blame "the cancerous, pernicious influence of the internet, video games, so-called Western values." Such criticism is common in Serbia, which has refused to fully face its role in the wars of the 1990s that accompanied the breakup of Yugoslavia.

Serbian war criminals are largely regarded as heroes, and pro-Russia and anti-Western sentiment have thrived in recent years as members of minority groups routinely face harassment and sometimes physical violence.

Serbia's last mass shooting was in 2013, when a war veteran killed 13 people. The assailant in Wednesday's violence, the country's first mass school shooting, was a 13-year-old boy who opened fire on his fellow students, killing seven girls, a boy and a school guard.

The next day, a 20-year-old man fired randomly in two villages in central Serbia, killing eight people. Both he and the boy in the primary school attack were apprehended. The boy is too young to be criminally charged and was placed in a mental clinic. The man, identified as Uros Blazic, faces charges of first-degree murder and unauthorized possession of guns and ammunition.

The motives of the attacks remain unknown. Blazic, who was arrested wearing a pro-Nazi T-shirt, told prosecutors during questioning on Saturday that he shot people he didn't personally know because he wanted to sow fear among residents, Serbian state broadcaster RTS reported.

While the country struggles to come to terms with its past and the recent shootings, authorities promised a gun crackdown and said they would boost security in schools and all over the country.

On Sunday, the Interior Ministry said individuals could hand over illegally kept weapons between Monday and June 8th without facing any charges. Those who ignore the order will face prosecution and if convicted, potentially years behind bars, government officials have warned.

"We invite all citizens who possess illegal weapons to respond to this call, to go to the nearest police station and hand in weapons for which they do not have proper documents," police official Jelena Lakicevic said.

The voluntary surrender applies to all firearms, explosive devices such as grenades, weapon parts and ammunition that people keep illegally at their homes, Lakicevic said.

In his third address to the nation since the killings, Serbian President Aleksandar Vucic said Sunday, "We expect to get millions of bullets that way."

The populist leader also criticized the political opposition for planning protests against his government for its handling of the crisis, saying that displays of division at such a time is "done nowhere in the world. It's bad for the country."

Opposition politicians have accused Vucic of undermining the rights of the two accused shooters to fair trials by predicting that the 20-year would "never again see the light of the day" and releasing medical information about the 13-year-old along with the salaries of his parents.

The opposition also alleged that the president was using his televised addresses to the nation to promote harsh emergency measures that are anti-democratic and illegal.