This article is more than
7 year oldCatalan MPs easily approved the move amid an opposition boycott.
Spanish Prime Minister Mariano Rajoy had told senators direct rule was needed to return "law, democracy and stability" to Catalonia.
The crisis began earlier this month when Catalonia held a controversial referendum on independence.
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.
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.
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."
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.
There were 214 votes in favour and 47 against.
Urging calm, Mr Rajoy said: "Spain is a serious country, it is a great nation and we are not prepared in any way to allow some people to liquidate our constitution."
He is holding a cabinet meeting to decide what measures to take.
It could include the firing of Catalan leaders, and the Spanish government taking control of the region's finances, police and publicly owned media.
After the 1 October referendum, Mr Puigdemont signed a declaration of independence but delayed implementation to allow talks with the Spanish government.
A deadline set by Madrid for him to clarify his intentions came and went, prompting Mr Rajoy to announce plans to impose direct rule.
Catalonia is one of Spain's richest, most distinctive regions and enjoys a high degree of autonomy.
But many Catalans feel they pay more to Madrid than they get back, and there are historical grievances too, in particular Catalonia's treatment under the dictatorship of General Franco.
Catalans are divided on the question of independence - an opinion poll earlier this year said 41% were in favour and 49% were opposed to independence.
Does Catalonia want to leave Spain?
16% of Spain's population live in Catalonia, and it produces:
25.6% of Spain's exports
19% of Spain's GDP
20.7% of foreign investment
Newer articles
<p>A US judge has ruled against Donald Trump getting his hush money conviction thrown out on immunity grounds.</p>