BARCELONA, Spain -- Catalonia's defiant bid to hold a referendum on independence from Spain degenerated into ugly scenes of mayhem on Sunday, with more than 800 people injured as riot police attacked peaceful protesters and unarmed civilians gathered to cast their ballots in a vote the government had banned as unconstitutional.

Hundreds of police armed with truncheons and rubber bullets were sent in from other regions to confiscate ballots and stop the voting, and amateur video showed some officers dragging people out of polling stations by the hair, throwing some down stairs, kicking them and pushing them to the ground. Anguished, frightened screams could be heard.

"What the police are doing is simply savage," said Jordi Turull, spokesman for the Catalan regional government, which backs independence. "It's an international scandal." He said Spain has become "the shame of Europe" with its iron-fist tactics.

Get Breaking News Delivered to Your Inbox

Police were acting on a judge's orders to stop the referendum, which the Spanish government had declared illegal -- and Prime Minister Mariano Rajoy said going forward with the vote only served to sow divisions.

In a televised address after the majority of polls closed Sunday, he thanked the Spanish police, saying they had acted with "firmness and serenity" -- comments sure to anger Catalonians.

Spanish Foreign Minister Alfonso Dastis said the violence, while "unfortunate" and "unpleasant" was "proportionate."

"If people insist in disregarding the law and doing something that has been consistently declared illegal and unconstitutional, law enforcement officers need to uphold the law," Dastis told The Associated Press in an interview.

By day's end, Catalan's health services said 844 people had been treated in hospitals for injuries, including two in serious condition and another person who was being treated for an eye injury that fit the profile of having been hit by a rubber bullet. At least 33 police officers were also injured.

BBC News reports that the national police and Guardia Civil -- a paramilitary force charged with police duties -- were sent into Catalonia in large numbers to prevent the vote from taking place.

Apparently the forces arrested three people, including a minor, for disobedience and assaulting officers.

People confront Spanish Civil Guard officers outside a polling station for the banned independence referendum in Sant Julia de Ramis, Spain, on Sun., Oct. 1, 2017. Reuters

No one knows precisely what will happen if Catalan officials use the vote -- chaotic as it was -- as a basis for declaring the northeastern region independent, a provocative move that would threaten Spain with the possible loss of one of its most prosperous regions, including the popular coastal city of Barcelona, the regional capital. It was also unclear how many of the region's 5.3 million eligible voters were able to cast ballots, how their votes would be counted and how many votes had been confiscated by police.

Catalans favoring a break with Spain have long wanted more than the limited autonomy they now enjoy, arguing that they contribute far more than they receive from the central government, which controls key areas including taxes and infrastructure. The police aggression on Sunday was likely to fuel the passion for independence.

Officials planning the police operation may have failed to take into account the ubiquitous use of smart phones with video recorders as violent images were broadcast across the world.

At the Pau Claris School in Barcelona, amateur footage filmed by one voter showed police roughing up unarmed people standing in their way. Amateur video from other locations showed similar tactics, with people seen being hit, kicked and thrown around by police, including elderly people with their dogs, young girls and regular citizens of all stripes. Many tried to shield themselves from being smacked on the head.

There were also some signs of provocation by activists. In footage released by the Spanish Interior Ministry, some protesters were seen throwing objects and metal barriers at riot police.

Elisa Arouca, who was waiting to vote outside the Estel school in central Barcelona, reacted with anger when national police agents yanked her and other prospective voters out of the way, then smashed the door open and confiscated the ballot boxes.

She had been planning to vote in favor to keeping Catalonia part of Spain, but decided instead to join the march for independence. She moved to another polling station to try and cast her vote in favor of breaking away.

"I was always against independence, but what the Spanish state is doing is making me change my mind," she said. "The national police and civil guard are treating us like criminals."

A member of the Israeli parliament, sent in as an observer of the vote, said she was shocked by the use of rubber bullets by Spanish police against crowds of unarmed voters.

"We did expect a normal democratic process," said Ksenia Svetlova, part of a delegation of 30 people invited by Catalan officials to observe the voting process. "We knew that a lot of police were here but still, you know, there should be a respect for the will of the people to vote regardless of what you think of the referendum."

Tensions were running so high that Barcelona played its soccer game against Las Palmas without fans after the team announced the match would be played behind closed doors shortly before kickoff, with thousands of soccer fans already outside the stadium. Barcelona wanted to postpone the game but said the Spanish league refused the request.

Manuel Condeminas, a 48-year-old IT manager who tried to block police from driving away with ballot boxes on Sunday, said police had kicked him and others before using their batons and firing the rubber bullets.

Elsewhere, civil guard officers, wearing helmets and carrying shields, used a hammer to break the glass of the front door and a lock cutter to break into the Sant Julia de Ramis sports center near the city Girona, which was being used as a polling station. At least one woman was injured outside the building, wheeled away on a stretcher by paramedics.

A woman yells at riot police near a a polling station for the banned independence referendum in Barcelona, Spain, on Sun., Oct. 1, 2017. Reuters

Clashes broke out less than an hour after polls opened, and not long before Catalonia regional president Carles Puigdemont was expected to turn up to vote at the sports center. Polling station workers reacted peacefully and broke out into songs and chants challenging the officers' presence.

Puigdemont was forced to vote in Cornella de Terri, near the northern city of Girona, his spokesman told The Associated Press.

Police had sealed off many voting centers in the hours before the vote to prevent their use. Others were filled with activists determined to hold their ground.

Spanish riot police forcefully removed a few hundred would-be voters from a polling station at a school in Barcelona. The scene was repeated at other locations, although voting was peaceful in some spots.

Daniel Riano, 54, was inside when the police pushed aside a large group gathered outside busted in the Estela school's front door.

"We were waiting inside to vote when the National Police used force to enter, they used a mace to break in the glass door and they took everything," he said. "One policeman put me in a headlock to drag me out while I was holding my wife's hand! It was incredible. They didn't give any warning."

Sanchez, leader of secessionist group ANC, tells a large crowd in Barcelona's main square he hopes that "very soon we will see the birth of a new Catalan state."

Sanchez warns local leaders "Now, don't let us down ... The moment of truth has arrived."

One voter, Júlia Graell, told BBC News that "police started to kick people, young and old," adding: "Today, I have seen the worst actions that a government can do to the people of its own country."