Days after the Spanish central government announced its plan to impose direct rule on Catalonia, deposing the elected regional government, the Catalonian government has declared independence, citing the outcome of a referendum earlier this month in which Spanish police fired rubber bullets and administered ferocious, unprovoked beatings against people heading to the polls.
The debate came after Catalan President Carles Puigdemont on Thursday opted against declaring independence or calling early elections, instead calling on MPs to decide.
A motion declaring independence was approved with 70 in favour, 10 against, and two abstentions in the 135-seat chamber.
The measure calls for the transfer of legal powers from Spain to an independent Catalonia.
But the Spanish Constitutional Court is likely to declare it illegal, and few in the international community will recognise Catalan statehood.
Immediately afterwards, Mr Rajoy called for all Spaniards to remain calm, promising to "restore legality" to Catalonia.