Catalonia declared independence from Spain less than an hour before a vote in the country’s Senate gave Madrid the power to seize the region’s autonomous powers.

The vote in the regional parliament followed a tense week of last-ditch negotiations between Madrid and Barecelona. Seventy of 135 Catalan deputies voted for independence, with 10 opposed and two blank ballot slips.

Opposition lawmakers had walked out of the chamber ahead of Friday’s vote in protest.

Rounds of applause broke out in the chamber as members of the parliament hugged and shook hands.

Thousands of people watched the voting process and the counting live on big screens outside Catalonia’s parliament in Barcelona, and cheered and danced after the motion was passed.

The motion calls for beginning an independence process that includes drafting Catalonia’s new top laws and opening negotiations “on equal footing” with Spanish authorities to establish co-operation.

On Thursday Catalan president Carles Puigdemont had ruled out calling a snap election, thought to have been a potential way of defusing tension with the central government.

Mr Puigdemont said he had not received sufficient guarantees that Madrid would hold off on its attempts to take control of the region.

Spain’s prime minister, Mariano Rajoy, tweeted immediately after the vote calling for calm. He said the rule of law would be restored in Catalonia.

Spain’s senate voted on Friday, shortly after the Catalan independence vote, to trigger Article 155 of the constitution and allow the imposition of direct rule.

The vote will give Madrid the authority to govern Catalonia is the first direct intervention by central authorities in the affairs of one of the country’s 17 autonomous areas.

Mr Rajoy will have the power to sack Mr Puigdemont and his cabinet among other measures. Mr Rajoy is understood to be planning immediately to enact the Article 155 provisions during an urgent meeting on Friday afternoon.

Catalonia independence referendum: Riot police clash with voters Show all 17 1 /17 Catalonia independence referendum: Riot police clash with voters Catalonia independence referendum: Riot police clash with voters A man faces off Spanish Civil Guards outside a polling station in Sant Julia de Ramis Reuters Catalonia independence referendum: Riot police clash with voters Riot police form a security cordon around the Ramon Llull school in Barcelona EPA Catalonia independence referendum: Riot police clash with voters Riot police evict a young woman during clashes between people gathered outside the Ramon Llull school in Barcelona EPA Catalonia independence referendum: Riot police clash with voters Spanish Civil Guard officers break through a door at a polling station in Sant Julia de Ramis Reuters Catalonia independence referendum: Riot police clash with voters Spanish National Police clash with pro-referendum supporters in Barcelona on Sunday AP Catalonia independence referendum: Riot police clash with voters Crowds raise their arms up as police move in on members of the public gathered outside to prevent them from voting in the referendum at a polling station where the President Carles Puigdemunt will vote later today Getty Catalonia independence referendum: Riot police clash with voters People confront Spanish Civil Guard officers outside a polling station Reuters Catalonia independence referendum: Riot police clash with voters Three man hold each other as they try to block a Spanish police van from approaching a polling station AP Catalonia independence referendum: Riot police clash with voters A woman shows a ballot to a Spanish Civil Guard officer outside a polling station Reuters Catalonia independence referendum: Riot police clash with voters A man wearing a shirt with an Estelada (Catalan separatist flag) and holding carnations faces off with a Spanish Civil Guard officer Reuters Catalonia independence referendum: Riot police clash with voters Police try to control the area as people attempt to cast their ballot at a polling station in Barcelona Getty Catalonia independence referendum: Riot police clash with voters A man is grabbed by officers as police move in on the crowds Catalonia independence referendum: Riot police clash with voters Two women argue with a Spanish National policeman during clashes between Catalan pro-independence people and police forces at the Sant Julia de Ramis sports centre in Girona EPA Catalonia independence referendum: Riot police clash with voters Sant Julia De Ramis in Spain Getty Catalonia independence referendum: Riot police clash with voters Confrontation outside a polling station in Barcelona, where police have tried to stop people voting AFP/Getty Images Catalonia independence referendum: Riot police clash with voters A Spanish National Police officer aims a rubber-bullet rifle at pro-referendum supporters in Barcelona AP Catalonia independence referendum: Riot police clash with voters Riot police clashed with voters as polls opened in Barcelona Sky News

The crisis stems from an independence referendum, held earlier this month, that Spanish judges had declared unconstitutional.

Before it went ahead Madrid authorities confiscated ballot papers and closed polling stations, with clashes erupting in the streets.

An overwhelming majority of those who did vote favoured secession, but turnout was low and there is a substantial section of the Catalan population that wants to remain a part of Spain.

Following Friday’s independence vote, European Council president Donald Tusk said “nothing changes” for the EU, adding it would continue only to deal with the Madrid government.

Mr Tusk urged Spain to favour “force of argument, not argument of force” in addressing the independence declaration.

The United States said Catalonia was an “integral part of Spain” and that it supported Spanish government efforts to keep the nation “strong and united.”