The Catalan autonomous region’s local government has declared that 2.26 million people have cast their ballots, a turnout of about 42 percent.

Catalonia's regional leader opened the door to a unilateral declaration of independence from Spain after voters defied a violent police crackdown and voted 90 percent in favor of breaking away.

Spanish Prime Minister Mariano Rajoy has previously ruled out independence and accused separatists of trying to "blackmail ... the whole nation". He offered all-party talks on the region's future.

Catalan officials say more than 800 people were injured in clashes with Spanish riot police during the referendum, which has pitched the country into its deepest constitutional crisis in decades and deepened a rift between Madrid and Barcelona.

"On this day of hope and suffering, Catalonia's citizens have earned the right to have an independent state in the form of a republic," Carles Puigdemont, the president of Catalonia said in a televised address.

"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."

Puigdemont added he would appeal to the European Union to look into alleged human rights violations during the vote. "Today the Spanish state wrote another shameful page in its history with Catalonia."

Catalan officials said 844 people had been injured in the police crackdown and the Spanish Interior Ministry said 12 police officers had been hurt.

Spain's deputy prime minister said force used by the police had been proportionate.

"The absolute irresponsibility of the regional government has had to be met by the security forces of the state," said Soraya Saenz de Santamaria.