Spain's Prime Minister Mariano Rajoy on Friday called for calm in a tweet posted minutes after the Catalan regional parliament declared independence from the rest of the country in a disputed vote that will likely be declared illegal.

"I ask for calm from all Spaniards. The rule of law will restore legality in Catalonia," Rajoy wrote.

Catalonia's regional parliament passed a motion Friday to establish an independent Catalan Republic, voting to secede from Spain after an acrimonious debate that saw opposition lawmakers walk out in protest before the vote.

Catalonia Spain PM Rajoy asks Senate for powers to depose Catalan president Puigdemont

The vote in Barcelona came after Spanish Prime Minister Mariano Rajoy delivered an impassioned speech in Madrid, urging the country's Senate to grant his government special constitutional measures that would allow it to take control of Catalonia's autonomous powers and halt the region's independence bid.

The vote was approved with 70 in favor of independence, 10 against and two blank ballots in Catalonia's 135-member parliament.

No country in the world has expressed support for independence for Catalonia, a region in northeastern Spain that has 7.5 million people.

Separatist lawmakers in the regional parliament erupted in applause and chants when the chamber's main speaker, Carme Forcadell, announced the passing of a motion to declare the region's independence.

The lawmakers stood to chant the Catalan official anthem, joined by dozens of guests. Regional President Carles Puigdemont and his vice president, Oriol Junqueras, exchanged congratulatory embraces and handshakes following the ballot.

Outside, thousands who had gathered near the parliament building to call for independence cheered, with some dancing and raising glasses after seeing the vote and the counting live on a giant screen.

Catalan parliament votes on independence: in pictures Show all 15 1 /15 Catalan parliament votes on independence: in pictures Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Catalan independence supporters react to the news that the Catalan Parliament voted to declare independence Getty Images Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Catalan separatists react as the Catalan Parliament votes the independence of Catalonia Rex Catalan parliament votes on independence: in pictures Catalan parliament votes for independence People react as they celebrate the unilateral declaration of independence of Catalonia AP Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Catalan government members, pro independence deputies, and Mayors from pro indpendence towns sing the Catalan anthem REUTERS Catalan parliament votes on independence: in pictures Catalan parliament votes for independence People celebrate after the approval of the declaration of a uniteral independence EPA Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Catalan pro-independence mayors raise their batons as they gather in the parliament AFP/Getty Images Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Catala president Carles Puigdemont sings the Catalan anthem AFP/Getty Images Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Protesters shouts slogans during a rally outside the Catalan Parliament AP Catalan parliament votes on independence: in pictures Catalan parliament votes for independence People react as they watch on giant screens a plenary session outside the Catalan regional parliament REUTERS Catalan parliament votes on independence: in pictures Catalan parliament votes for independence An aerial view shows thousands of people gathering near the Catalan regional Parliament EPA Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Protesters during a rally outside the Catalan Parliament AP Catalan parliament votes on independence: in pictures Catalan parliament votes for independence People react as they watch on giant screens REUTERS Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Leftist party CUP leader Anna Gabriel casts her ballot REUTERS Catalan parliament votes on independence: in pictures Catalan parliament votes for independence A protester reacts AP Catalan parliament votes on independence: in pictures Catalan parliament votes for independence Popular Party leader Xavier Garcia Albiol gestures REUTERS

The motion that passed 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 cooperation.

Hours earlier in Madrid, Rajoy made his case for measures to keep Spain unified. The conservative leader, who received sustained applause before and after his speech, told the chamber that Spain was facing a challenge not seen in its recent history.

What is happening in Catalonia is "a clear violation of the laws, of democracy, of the rights of all, and that has consequences," he said.

Rajoy said his government's first move would be to dismiss Puigdemont and his regional ministers if the Senate approves the Spanish government's use of Article 155 of the Constitution in a vote later Friday.

The special measures, he said, were the only way out of the crisis, adding that Spain wasn't trying to take away liberties from the 7.5 million Catalans but instead trying to protect them.

Rajoy says the measures to take over Catalan affairs are aimed at restoring order and has promised to call a new regional election once that is achieved.

If Rajoy's measures are granted, it will be the first time in four decades of democratic rule that the national government in Madrid would directly run the affairs of one of Spain's 17 semi-autonomous regions, a move that will likely fan the flames of the Catalan revolt.

​Rajoy's conservative Popular Party has an absolute majority in the Senate, thus guaranteeing the approval of his proposals. But he has also sought support from the country's main opposition parties. It will then be up to the government when to implement the measures taking over the Catalan government.

Catalonia represents a fifth of Spain's gross domestic product and polls show its people roughly evenly divided over independence.

In Barcelona before the vote, about 500 mayors of Catalan towns chanted "independence!" and raised their ceremonial wooden staves in a hall inside the regional parliament.

The proposal that was approved had been submitted by the ruling Catalan Together for Yes coalition and their allies in the far-left CUP party. It states that "we establish the Catalan Republic as an independent and sovereign state of democratic and social rule of law."

"Today is the day that many Catalans' long-held desire will be fulfilled, but tomorrow the cruel reality will set in with the Spanish state armed with its interpretation of Article 155," the former speaker of the Catalan parliament Joan Rigol i Roig, told The Associated Press. "We can only hope that the conflict remains in the political realm."

The independence move was opposed by all opposition lawmakers in the prosperous region.

Carlos Carrizosa, spokesman for the pro-union Citizens party, the leading opposition party in Catalonia's parliament, ripped a copy of the proposal into pieces during the debate ahead of the vote.

"With this paper, you leave those Catalans who don't follow you orphaned without a government. And that's why Citizens won't let you ruin Catalonia," he said. "Today is a sad, dramatic day in Catalonia. Today is the day that you (secessionists) carry out your coup against the democracy in Spain."

Marta Ribas of the leftist Catalonia Yes We Can party said "two grave errors" were being committed Friday.

"First, the Article 155 which will take away our rights and impact all the country. But it is a grave error to respond to that barbarity with an even bigger error," she said. "The unilateral declaration of independence won't protect us against Article 155, you will only make the majority of people suffer."

Before the parliament session, large crowds of independence supporters gathered outside in a Barcelona park, waving Catalan flags and chanting slogans in favor of a new state.

"I am here today because we will start the Catalan Republic," said 68-year-old protester Jordi Soler. "Madrid is starting with total repression — and there is no longer any (other) option."

Puigdemont scrapped hopes of a possible end to the political deadlock on Thursday when he opted not to call an early election and halt the drift toward independence.