Catalonia's president has vowed to press ahead with a bid for independence from Spain after the national parliament rejected his request for a referendum.

Spanish MPs on Tuesday overwhelmingly voted against the referendum for Catalonia's independence, following a seven-hour debate.

I can't imagine Spain without Catalonia, or Catalonia out of Europe.

Mariano Rajoy, prime minister of Spain

The petition was rejected by 299 to 47 votes. Only Catalan and Basque nationalist parties voted in favour.

"Some would like to present this as the end of the matter but, as president of Catalonia, I say to them that it is not the end," Artur Mas, the region's president, said in a speech immediately after votes were counted.

"Catalan institutions will search through the legal frameworks to find a way to continue with this consultation."

During the debate, Mariano Rajoy, Spain's prime minister, said: "Maybe I believe in Catalonia more than you do. I love Catalonia like it was my own.

"Together we all win, separate we all lose. This isn't just a question of law, but of sentiment ... I can't imagine Spain without Catalonia, or Catalonia out of Europe."

Catalan politicians said the movement had gained too much momentum to stop the referendum, which Mas had said would take place on November 9.

Rajoy said he will use the courts to block the vote.

If the referendum is shut down by the courts, Mas is expected to use the next election in Catalonia, which must be held by 2016, as a proxy vote on independence.

Opinion polls show that roughly half of Catalans support independence, but a much higher number want the right to vote on the matter. Catalonia accounts for a fifth of the Spanish economy and 16 percent of its population.