Catalan leader Carles Puigdemont says the Spanish region has won the right to statehood following a contentious referendum that was marred by violence.
He said the door had been opened to a unilateral declaration of independence.
Catalan officials later said 90% of those who voted backed independence in Sunday’s vote. The turnout was 42.3%.
Spain’s constitutional court had declared the poll illegal and hundreds of people were injured as police used force to try to block voting.
Officers seized ballot papers and boxes at polling stations.
“With this day of hope and suffering, the citizens of Catalonia have won the right to an independent state in the form a republic,” Mr Puigdemont said in a televised address flanked by other senior Catalan leaders.
“My government in the next few days will send the results of today’s vote to the Catalan parliament, where the sovereignty of our people lies, so that it can act in accordance with the law of the referendum.”
Earlier, as voting ended, Spanish Prime Minister Mariano Rajoy said Catalans had been fooled into taking part in an illegal vote. He called it a “mockery” of democracy.
“At this hour I can tell you in the strongest terms what you already know and what we have seen throughout this day. There has not been a referendum on self-determination in Catalonia,” he said.
Large crowds of independence supporters gathered in the centre of the regional capital Barcelona on Sunday evening, waving flags and singing the Catalan anthem. Anti-independence protesters have also held rallies in Barcelona and other Spanish cities.
How bad was the violence?
The Catalan government said more than 800 people had been injured in clashes across the region. Those figures included people who had suffered relatively minor complaints such as anxiety attacks.
The Spanish interior ministry said 12 police officers had been hurt and three people arrested. It added that 92 polling stations had been closed.
In Girona, riot police smashed their way into a polling station where Mr Puigdemont was due to vote, and forcibly removed those inside. Mr Puigdemont voted at another station.
The BBC’s Tom Burridge in Barcelona witnessed police being chased away from one polling booth after they had raided it.
TV footage showed riot police using batons to beat a group of firefighters who were protecting crowds in Girona.
The national police and Guardia Civil – a military force charged with police duties – were sent into Catalonia in large numbers to prevent the vote.
The Catalan police – the Mossos d’Esquadra – have been placed under Madrid’s control, however witnesses said they showed little inclination to use force on protesters.
Barcelona Mayor Ada Colau condemned police actions against the region’s “defenceless” population, but Spain’s Deputy Prime Minister Soraya Saenz de Santamaria said police had “acted with professionalism and in a proportionate way”.
How much voting took place?
Catalan authorities said 319 of about 2,300 polling stations across the region had been closed by police while the Spanish government said 92 stations had been closed.
Since Friday, thousands of people have 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.
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.
What happens next?
Analysis: Tom Burridge, BBC News, Barcelona
Spain’s complicated relationship with the region of Catalonia is headed for the unknown.
After violence by Spanish police, a declaration of independence by Catalonia’s regional government seems more likely than ever before.
Overnight Catalonia’s government claimed a turnout of 2.2 million people – not far off half of the electorate. It also said that 90% voted “yes” for independence from Spain.
But given the chaotic nature of the vote, all figures should be taken with a pinch of salt. On Monday the government in Madrid will hold talks with Spanish parties to discuss a response to the biggest political crisis this country has seen in decades.