Catalonia's parliament has voted to change regional laws so that it can elect fugitive former leader Carles Puigdemont as president - even though it is almost certain to be blocked in court.
The slim majority of separatist representatives in the parliament voted in favour of allowing Catalonia's president to be sworn in without being present and to govern from abroad.
Mr Puigdemont is on bail in Germany awaiting extradition to Spain, where he is accused of rebellion and misuse of public funds in organising an unauthorised referendum last year on Catalonia's independence.
Catalan separatist parties have defied the Spanish government for the past six months by continuing with efforts to secede from Spain.
Court rulings have repeatedly thwarted their ambitions because the constitution says Spain is "indivisible".