Catalonia's parliament has passed a law paving the way for an October 1 referendum on whether to declare independence from Spain - a vote fiercely opposed by the central government in Madrid.

The so-called "referendum bill" was adopted on Wednesday by the regional parliament, which is controlled by pro-independence parties, with 72 votes in favour and 11 abstentions.

Politicians who oppose independence for the wealthy northeastern region of Spain left the chamber before the vote.

OPINION: Why Catalonia should be given a say on its future

After the law passed, separatist legislators sang the region's anthem, "Els Segadors", which recalls a 1640 revolt in Catalonia against the Spanish monarchy.

Xavier Garcia Albiol, the head of the Catalan branch of the conservative Popular Party, accused the separatist politicians of wanting to cause Spain's "biggest institutional crisis" since a failed coup attempt in 1981 when armed civil guards took over parliament.

'Not allowed to do so'

Catalonia, a region of 7.5 million people with its own language and culture, accounts for about 20 percent of Spain's economic output and has significant powers over matters such as education, healthcare and welfare.

But Spain's economic worries, coupled with a perception that the region pays more in taxes than it receives in investments and transfers from Madrid, have helped push the cause of secession from the fringes of Catalan politics to centre stage.

If the region pushes through with the referendum, it will move even further towards a collision course with the national government, which has repeatedly argued that any attempt to break away from Spain is illegal and will not be recognised.

The state legislature move is important, as the legal underpinnings for such a referendum have been questioned.

Now that it has been approved legislatively, Catalonian President Carles Puigdemont is expected to sign the measure into law either late on Wednesday or early on Thursday.

OPINION: The case against Catalan secession

However, the Constitutional Court of Spain is already expected to review the law this week and declare it null and void, as it has done with similar attempts in the past.

Should the referendum take place and yield a majority for seceding, supporters say they would move to break away from Spain "within two days".

Spanish Prime Minister Mariano Rajoy repeated a few days ago that there is no way he would allow the economically important region to break away.

"The Catalonians cannot carry out this referendum as planned because they are not allowed to do so either by the Constitution or existing law," he said.

Under the Spanish Constitution, referendums on sovereignty must be held nationally, not regionally.

According to Article 155, Madrid has the power to intervene directly in the running of Catalonia's regional government, forcing it to drop the vote.

In 2014, months after Scotland voted to stay in the UK, pro-independence campaigners staged a symbolic ballot, organised by volunteers rather than government officials to get around court restrictions.

Some two million people voted in favour of secession in that non-binding ballot, though turnout was relatively low.