Spanish Prime Minister Mariano Rajoy said on Sunday that the rule of law had prevailed in Catalonia because an independence referendum in the region prohibited by the courts had been blocked.

“Today there has not been a self-determination referendum in Catalonia. The rule of law remains in force with all its strength,” he said in a televised address.

Earlier, Spanish riot police smashed their way into polling stations in Catalonia and fired rubber bullets at protesters outside one Barcelona polling station to try to halt a disputed independence referendum.

Nearly 350 people, including some police, were injured in the melee, officials said.

The officers fired the rubber bullets while trying to clear protesters who were attempting to prevent National Police cars from leaving after police had confiscated ballot boxes from the voting center. The Spanish government has ordered police to stop the voting process in Catalonia, saying it's illegal.

The chaotic confrontations led to a war of words as each side blamed the other for the deteriorating situation.

“Police brutality will shame forever the Spanish state,” Catalan President Carles Puigdemont said as crowds cheered.

Top Spanish officials defended the police actions.

Police acted with “firmness and proportionality,” declared Spanish deputy prime minister Soraya Saenz de Santamaria, adding that authorities weren't going after voters but referendum material.

She accused the Catalan government of gross irresponsibility in staging the vote.

“There hasn't been a referendum or the semblance of one,” she said.

Jon Marauri, who is from the Basque Country and witnessed the scenes outside the polling stations, showed an AFP reporter one of the rubber bullets he picked up after police charged hundreds of protesters who were preventing the officers from leaving a polling station.

“I am not the only one who has this, lots of other people picked them up,” the 22-year-old engineering student said as he held the rubber bullet.

Another demonstrator, David Pujol, 37, showed an injury to his leg that he said was caused by a rubber bullet. Several other demonstrators reported hearing rubber bullets being fired.

Catalan leader Carles Puigdemont lashed out Sunday at the violence used by Spain's national police in dispersing people in Barcelona who wanted to vote.

“The unjustified use of violence, which is both irrational and irresponsible, by the Spanish state will not stop the will of the Catalan people,” he told reporters, accusing police of using “batons, rubber bullets and indiscriminate force” against people demonstrating “peacefully”.

Tensions have been on the rise since the vote was called in early September, crystalizing years of defiance by separatists in the affluent region, which contributes mightily to Spain's economy.

As one of Spain's 17 autonomous regions, Catalonia enjoys ample rights but key areas such as infrastructure and taxes are in the hands of Madrid. Separatist Catalans have long complained the region is contributing too much to the state while not getting enough in return.

Catalonia's government spokesman said 337 people have been injured, some seriously, during the police crackdown on Sunday and Spain's Interior Ministry said 11 police officers were injured.

The regional government's spokesman, Jordi Turull, blamed the violence directly on Spanish Prime Minister Mariano Rajoy.

He said actions by Spanish National Police and Civil Guard forces on Sunday were politically motivated and showed “a clear motivation to harm citizens.”

Catalan international affairs director, Raul Romeva, said regional authorities would appeal to European authorities to examine the violations of human rights by Rajoy's government.

Manuel Condeminas, a 48-year-old IT manager who tried to block police from driving away with the ballot boxes, said agents had kicked them before using their batons and firing the projectiles, which were ball-shaped.

Elsewhere, Civil Guard officers, wearing helmets and carrying shields, used a hammer to break the front door glass and a lock cutter to break into the Sant Julia de Ramis sports center near the city of Girona.

At least one woman was injured outside the building and wheeled away on a stretcher by paramedics.

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 inside the building reacted peacefully, breaking 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.

The Spanish government and its security forces are trying to prevent voting in the independence referendum, which is backed by Catalan regional authorities. Spanish officials had earlier said that force wouldn't be used, but that voting wouldn't be allowed.

Spain's Constitutional Court has suspended the vote. Regional separatist leaders pledged to hold it anyway, promising to declare independence if the “yes” side wins, and have called on the region's 5.3 million eligible voters to cast ballots.

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

At one school in Barcelona, Spanish riot police forcefully removed a few hundred would-be voters from a polling station. Daniel Riano was inside the building when the police pushed aside a large group gathered outside and 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,” the 54-year-old Riano 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.” National Police and Civil Guard officers also showed up in other polling centers where Catalan officials were expected.

Catalans braved rain to vote and defied police orders to abandon designated voting stations.

Joaquim Bosch, a 73-year-old retiree at Princep de Viana high school, where a crowd was growing Sunday morning, said he was uneasy about a possible police response.

“I have come to vote to defend the rights of my country, which is Catalonia,” Bosch said. “I vote because of the mistreatment of Catalonia by Spain for many years.”

AP reporters saw ballot boxes wrapped in plastic bags being carried into some of the polling stations in Barcelona that were occupied overnight by parents and activists.

The plastic ballot boxes, bearing the seal of the Catalan regional government, were placed on tables, prompting cheers from hopeful voters who had gathered in the schools before dawn.

An amateur video filmed by a voter in Barcelona shows Spanish police kicking, beating and pulling people by the hair in clashes that took place as they tried to stop a referendum on independence in the northeastern region of Catalonia.

The video, acquired by the Associated Press, show National Police officers pulling and pushing people down a stairway at the Pau Claris School in the Sant Marti neighborhood Sunday. At one point, it shows an officer jumping down the steps and apparently stomping on a person on the floor.

One person can be seen being pulled by the hair and others kicked on the ground. People can be heard screaming wildly and shouting “Out!” at the officers.

The person that filmed the video said voters were simply sitting and trying to slow the police operation down. She said she saw no provocations. She asked for her name not to be published.

In an effort to overcome the determined Spanish police efforts, Catalan officials announced that voters would be allowed to cast ballots in any location and could use ballots printed at home.

Regional government spokesman Jordi Turull also said a group of “academics and professionals” had been invited to serve as election observers. The official electoral board appointed by the regional parliament was disbanded last week to avoid hefty fines by Spain's Constitutional Court.

“We are under conditions to be able to celebrate a self-determination referendum with guarantees,” Turull said in a press conference. “Our goal is that all Catalans can vote.”

Courts and police have been cracking down for days to halt the vote, confiscating 10 million paper ballots and arresting key officials involved in the preparations.

On Saturday, Civil Guard agents dismantled the technology to connect voting stations, count the votes and vote online, leading the Spanish government to declare that holding the referendum would be “impossible.”

Mixed reactions in Madrid

On the streets of Madrid there are mixed reactions to the Spanish government's crackdown on the independence referendum in Catalonia, where police were seen beating and kicking voters as they confiscated ballots.

Francisco Lopez, 53, said the authorities' use of force to stop the voting was justified. He says “when there is an unlawful act, the security forces are there to prevent this unlawful act.”

Jose Daniel Rodrguez, a 67-year-old university teacher, disagreed, saying the Spanish government should have let the vote go ahead. He says “in a democratic society, everyone has the right to express themselves.”

Others called for both sides to resolve the situation through negotiations, not police operations.

Ignacio Osorio, 51, says “I believe that from today we have to sit and talk, without conditions.”