People queue to light candles ahead of a funeral service for five young men killed, in the village of Malo Orasje near the town of Mladenovac, about 60 kilometres (37 miles) south of Serbia's capital Belgrade, on May 6, 2023, in the aftermath of a drive-by shooting. (PHOTO / AFP)

BELGRADE – A 20-year-old Serbian man suspected of killing eight people and wounding 12 others has confessed to the crime, the prosecutors' office in the town of Smederevo near Belgrade said in a statement on Saturday.

Serbia is in shock and mourning after two mass shootings: A school massacre in the capital on Wednesday in which nine people were killed, and the rampage outside the city on Thursday to which the 20-year-old has confessed. The suspects are in custody in connection with both cases.

The prosecutors said a man identified only as UB has admitted shooting at numerous people in three different locations near the town of Mladenovac on Thursday with an automatic rifle to "intimidate the population in those places"

In a statement seen by Reuters, the prosecutors said a man identified only as UB has admitted shooting at numerous people in three different locations near the town of Mladenovac on Thursday with an automatic rifle to "intimidate the population in those places".

UB is suspected of committing several crimes including aggravated murder, illegal production, possession, carrying and trafficking of weapons and explosive materials, and of kidnapping, said the prosecutors in Smederevo, the municipality where some of the shooting occurred.

ALSO READ: 8 dead in Serbia's second mass shooting, suspect arrested

No lawyer for the suspect has been named.

Following the shooting rampage, UB got in a taxi and forced the driver to take him to the town of Kragujevac where he was arrested on Friday morning.

A girl shot in the head in a school shooting in Serbia in which eight pupils and a guard were killed is still in critical condition, RTS state TV reported on Saturday.

Burials were being held on Saturday for four of the pupils and the guard killed in the school shooting and five young men killed in the second rampage.

"When you hear that it happens in Russia or America you do not feel comfortable, not to mention (when something happens) here where you know them all," Jovica Markovic from the village of Malo Orasje, where the funeral of the five young men will be held, told Reuters.

ALSO READ: Boy shoots dead nine people in Belgrade classroom

"We are all related, we all know each other… and they are all young," said Markovic, whose cousin lost a grandson in the second shooting.

Following the shootings, the government introduced a set of measures aimed at preventing violence in schools and reducing the number of weapons held by civilians.

Despite strong gun controls, Serbia and the rest of the Western Balkans are awash with military-grade weapons and ordnance that stayed in private hands after the 1990s wars that tore apart the former Yugoslavia.

Opposition parties, who blame the government of Prime Minister Ana Brnabic for failing to prevent the two shootings, called on supporters to join an anti-government march on Monday evening in Belgrade.

Serbia is holding three days of mourning, with flags at half mast and no entertainment programs on television.

READ MORE: 9 dead, 7 wounded in shooting at Texas mall

Flowers were laid and candles lit for the third consecutive day on Saturday in front of the Vladislav Ribnikar school in Belgrade. People lined up on Saturday to sign a book of condolence at the school.

Vigils have been held in other parts of Serbia, including the central town of Cacao and Novi Sad in the north.

In countries throughout the region – Bosnia, Croatia, Kosovo, Montenegro and North Macedonia – people have also paid their respects, lighting candles in main squares. Bosnia and Montenegro were also holding days of mourning.

The suspect in the school shooting is a 13-year-old boy who police said surrendered on Wednesday after taking two of his father's handguns to carry out the shooting.