A handful of stone-throwing youngsters tried to prevent ambulances from transferring 28 elderly coronavirus patients to a residence in their town in southern Spain, police said Wednesday.

The incident occurred as the virus death toll soared to 3,434 in Spain, overtaking China, with elderly people bearing the brunt of the outbreak.

Police said the protest occurred on Tuesday afternoon when a convoy of ambulances tried to enter La Linea de Concepcion, an impoverished city in Andalusia which flanks Gibraltar.

The protesters hurled stones and shouted insults at the ambulances and even tried to block their path by parking a car in the middle of the road, police said, indicating two men aged 32 and 25 were arrested.

The pensioners were being transferred to alternative accommodation in La Linea where they could receive medical treatment because their care home in Alcala del Valle near Malaga "was being disinfected", a police source said.

At the residence, around 50 people, "mostly youngsters" stood outside, "threatening and insulting the police and those who had brought" them, warning of further protests if more sick pensioners were brought in, he said.

Further disturbances flared up later in the evening with protesters throwing objects from nearby rooftops, including "flammable material", police said.

Despite an unprecedented national lockdown to curb the outbreak, the virus has now infected 47,610 people in Spain, with the vast majority of fatalities elderly.

Over the past week, Spain has been rushing to try and protect its elderly population after a dozens of deaths at care homes across the country, with the army sent in to conduct a massive deep-clean operation.

A sprawling city with high unemployment, La Linea is located in the southern Cadiz province and is notorious for being a haven for drug trafficking and tobacco smuggling.

"There is a tense atmosphere in the city because those involved in illegal activities like smuggling tobacco or hashish can't do anything, they can't leave their home without justification," the police source said.

"And when they try to go out, we catch them straight away because with no-one in the streets, the patrols can move much faster because there's no traffic."