Spanish police have said they arrested a woman who went surfing when she should have been in quarantine after testing positive for Covid-19.

Gloved officers in white hazmat suits marched the handcuffed woman off the beach in the northern city of San Sebastian as sunbathers looked on, a video posted to Twitter on Monday showed.

The video quickly became a viral hit.

The woman, reportedly a lifeguard, could be seen in the video initially ignoring appeals from police for her to get out of the water before she finally returned to land and argued with officers.

"We were informed that this person had tested positive (for Covid-19) and was on sick leave and that she still went surfing," a spokeswoman for local police said.

As in other European nations, Spaniards infected with the coronavirus must self-quarantine at home until they are cured to prevent spreading the disease or face hefty fines.

Spain this week become the first country in western Europe to pass 500,000 coronavirus infections.

The disease has killed nearly 30,000 people there, one of the highest tolls in the world.