Catalonia’s independence referendum has begun in chaotic fashion, 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, witnesses said police had fired rubber bullets during pro-referendum protests.
Thirty-eight people have been injured, most of them lightly, say Catalan emergency services.
Catalan leader Carles Puigdemont condemned the action of federal police.
“The unjustified use of violence… by the Spanish state will not stop the will of the Catalan people,” he told reporters.
How is the day unfolding?
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.
‘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”.