The Catalan government said that of the 43% of potential voters who took part, 90% were in favour of independence. But Spain's Constitutional Court had ruled the vote illegal.
What happened in the Catalan parliament?
A motion declaring independence was approved on Friday with 70 in favour, 10 against, and two abstentions in the 135-seat chamber.
The measure calls for the transfer of legal powers from Spain to an independent Catalonia.
But the Spanish Constitutional Court is likely to declare it illegal, while the US, UK, Germany and France all expressed support for Spanish unity.
European Commission chief Jean-Claude Juncker said the EU "doesn't need any more cracks, more splits".
Catalan President Carles Puigdemont has called for supporters to "maintain the momentum" in a peaceful manner.
Crowds have been celebrating the declaration of independence and Spanish flags have been removed from some regional government buildings in Catalonia.
The mood in the crowd
By James Reynolds in Barcelona
The pro-independence crowd outside the parliament followed the session vote by vote. Some had their mobile phones on speaker, to allow listeners at the other end a taste of the atmosphere.
The crowd met every Yes vote with a cheer - and every No with a boo. At the end, there was a huge cheer.
"We're finally free," a woman next to me said, as she began to cry. "We are oppressed here. We're fighting for our freedom."
But around the corner, away from the demonstration, views were different.
"It's disastrous," said one man. "It's the result of an extended manipulation which does not reflect the will of the Catalan people."
What will the Spanish government do next?
Soon after the vote at the regional parliament, the Senate - Spain's upper house - made the unprecedented step of approving measures allowing the Spanish government to impose direct rule over Catalonia.