Catalonia's independence referendum has descended into chaos, with clashes occurring as police attempt to prevent the vote from taking place.
The Spanish government has pledged to stop a poll that was declared illegal by the country's constitutional court.
Police officers are preventing people from voting, and seizing ballot papers and boxes at polling stations.
In the regional capital Barcelona, police used batons and fired rubber bullets during pro-referendum protests.
Catalan emergency services said they had treated 38 people who were injured when police pushed back crowds of voters and forced their way into polling stations.
The Spanish interior ministry said 11 police officers had been injured.
Catalan leader Carles Puigdemont condemned the action of the national police and Guardia Civil, who were sent into Catalonia in large numbers to prevent the vote from taking place.
"The unjustified use of violence... by the Spanish state will not stop the will of the Catalan people," he told reporters.
But Spanish Interior Minister Juan Ignacio Zoido blamed Mr Puigdemont for what he termed the day's senseless events.
And the Guardia Civil tweeted (in Spanish) that it was "resisting harassment and provocation" while carrying out its duties "in defence of the law".
What are the latest developments?
The ballot papers contain just one question: "Do you want Catalonia to become an independent state in the form of a republic?" There are two boxes: Yes or No.
Ahead of the polls opening, the Catalan government said voters could print off their own ballot papers and use any polling station if their designated voting place was shut.
In the town of Girona, riot police smashed their way into a polling station where Mr Puigdemont was due to vote.
Television footage showed them breaking the glass of the sports centre's entrance door and forcibly removing those attempting to vote.
However, Mr Puigdemont was still able to cast his ballot at another polling station.
Since Friday, thousands of separatist supporters had occupied schools and other buildings designated as polling stations in order to keep them open.
Many of those inside were parents and their children, who remained in the buildings after the end of lessons on Friday and bedded down in sleeping bags on gym mats.
In some areas, farmers positioned tractors on roads and in front of polling station doors, and school gates were taken away to make it harder for the authorities to seal buildings off.
Referendum organisers had called for peaceful resistance to any police action.
Meanwhile, both FC Barcelona and the Catalan football federation have asked the Spanish football league for tonight's match against Las Palmas to be suspended.
'Mood of celebration'
Tom Burridge, BBC News, Barcelona
It began in the dark and the rain. Daniel, who arrived at his local school at 01:00 and slept in the street outside, said his grandfather would have been proud of him.
He and hundreds of others blocked the entrance for several hours before this polling station opened.
Suddenly there was silence. Two officers from Catalonia's regional police force had arrived.
But a human wall was formed, and the police left.
National Spanish riot police arrived at another polling station nearby in Barcelona but again, people there kept them back.
One witness said there were scuffles and showed me a photo of a middle-aged woman with a bloody face.
But inside the school sports hall, there is a mood of celebration as people take selfies as they cast their votes.
Catalonia's former President, Artur Más - the man in charge when Catalan nationalists really started pushing for a referendum - told me that people were voting peacefully in the face of "a violent Spanish state".
How did Madrid prepare for the vote?
Thousands of extra police officers have been sent to the region, many of them based on two ships in the port of Barcelona.
The Spanish government has put policing in Catalonia under central control and ordered the regional force, the Mossos d'Esquadra, to help enforce the ban on the illegal referendum.
In a show of force ahead of the poll, Spanish authorities seized voting materials, imposed fines on top Catalan officials and temporarily detained dozens of politicians.
Police have also occupied the regional government's telecommunications centre.
Why is a vote being held?
Catalonia, a wealthy region of 7.5 million people in north-eastern Spain, has its own language and culture.
It also has a high degree of autonomy, but is not recognised as a separate nation under the Spanish constitution.
Pressure for a vote on self-determination has grown over the past five years.
But Spanish unionists argue Catalonia already enjoys broad autonomy within Spain, along with other regions like the Basque Country and Galicia.
Why is Madrid so opposed?
Spanish Prime Minister Mariano Rajoy says the vote goes against the constitution, which refers to "the indissoluble unity of the Spanish nation, the common and indivisible homeland of all Spaniards".
Central government spokesman Iñigo Mendez de Vigo accused the Catalan government of being inflexible and one-sided, but it is a charge that Catalan nationalists throw back at Madrid itself.
Demonstrations by independence campaigners have been largely peaceful.
On the eve of the vote, thousands of demonstrators calling for Spanish unity held rallies in cities across Spain, including in Barcelona.
They waved Spanish flags and carried banners reading "Catalonia is Spain".