A new regional election will be held in Catalonia on Dec 21, Prime Minister Mariano Rajoy said in a televised address on a day of high drama.
It will allow the government to dismiss the Catalan president and regional ministers, and then take over the region's finances, policing and most until elections can be called.
Catalonia's parliament met to discuss the issue late Thursday, where opposition lawmakers pleaded with Puigdemont to find a solution to the standoff closely watched by a European Union wary of nationalist and secessionist sentiment, particularly after Britain's dramatic decision to leave the bloc.
Pro-independence activists had called for a human shield around government buildings to thwart Spanish efforts to take control and protect their representatives.
In a stunning show of defiance of Madrid, the Catalan parliament had voted in the afternoon to make a unilateral declaration of independence.
Rajoy immediately called for calm despite the vote, which Spain is deeply set against.
The crisis has now reached a new and possibly risky level as independence supporters have called for a campaign of disobedience.
Catalonia held an independence referendum on Oct 1 which was declared illegal by Madrid and marred by heavy-handed national police tactics to stop it. Many had already suffered too much, he said, and the uncertainty was further driving businesses out of the region.
Catalans are fiercely protective of their language, culture and autonomy - restored after the 1939-75 dictatorship of Francisco Franco. They have the force.
Based on the vote, Puigdemont threatened to declare an independent republic. "I hope the Spanish government favours force of argument, not argument of force". "The clash is here and it won't be pretty", Antonio Barroso, a political risk analyst at Teneo Intelligence in London, said in an email to clients.
People celebrate in front of the Catalan regional government headquarters after the regional parliament declared independence from Spain in Barcelona on Friday.
"The separatists don't have a road map", she said. "They are approaching a cliff. with consequences that are hard to predict right now", says Joan Barcelo, a researcher on political conflicts at Washington University in St. Louis.
Two right-wing parties, Citizens (Cs) and People's Party (PP), along with the centre-left Socialist Party of Catalonia (PSC) staged walk-out during the voting.
Rajoy, who received rapturous applause before and after his speech in the Senate in Madrid, told the chamber that Spain was facing a challenge not seen in its recent history. Madrid has regarded the vote as illegal and several world leaders have voiced support for Spain. Any perceived over-reaction by Madrid could inflame the situation: increasing global criticism and pushing politically undecided Catalans into the hands of the secessionists.
Catalonia accounts for about 16 percent of Spain's population and a fifth of its economic output.