A vote on independence for Catalonia has shown more than 80% in favour.
It was holding a formal referendum in the autonomous north-eastern region.
More than two million people out of an estimated 5.4 million eligible voters took part in the ballot.
Catalan leader Artur Mas hailed the poll “a great success” that should pave the way for a formal referendum.
“We have earned the right to a referendum,” he told cheering supporters.
“Once again Catalonia has shown that it wants to rule itself.”
He added: “I ask the people in the world, I ask the media and I also ask the democratic governments in the world to help the Catalan people decide its political future.”
The ballot was held in the face of fierce opposition from the Spanish government.
Voters were asked two questions – whether they wanted Catalonia to be a state and whether they wanted that state to be independent.
Officials said 2,236, 806 people had taken part in the “consultation of citizens” and that with almost all votes counted, 80.72% had answered yes to both questions.
Just over 10% voted yes for the first question and no for the second, he said, and about 4.5% voted no to both questions.
Opinion polls suggest that as many as 80% of Catalans want an official referendum on the issue of Catalonia’s status, with about 50% in favour of full independence.
More than 40,000 volunteers helped to set up and run the informal exercise.