Separatist Roger Torrent has been elected the new president of the Catalan Parliament, in a move likely to frustrate the national Spanish government in Madrid.
Torrent, a lawmaker with the pro-independence Esquerra Republicana party, was elected to the key role - equivalent to the Speaker of the House of Commons - after receiving 65 votes. Rival candidate Jose Maria Espejo-Saavedra, of the loyalist Ciudadanos party, received 56.
The ballot went to a second round, as no-one was able to get the 68 votes required for an overall majority in the first. Although the results were exactly the same second time round, Torrent was only required to obtain a simple majority when the vote was re-run. He was helped by nine abstentions.
In addition to his role in the Catalan Generalitat, Torrent is the mayor of Sarria de Ter and will be the youngest president in the history of the regional chamber, at just 38 years old.
Prior to his election, Torrent said he was "very proud" to be standing for the role and "grateful to my party which has shown the confidence to put me forward as president in these crucial times."
Torrent will replace Carme Forcadell, who was imprisoned and then released in the crackdown which followed Catalonia's declaration of independence in late October.
The role of president of the Catalan government, previously held by Carles Puigdemont, remains vacant pending the formation of a governing coalition. Ines Arrimadas, leader of Ciudadanos, emerged with the highest vote in the recent election but her party lacks an overall majority and has little prospect of obtaining one.
Puigdemont, who remains in self-imposed exile in Belgium, has himself talked of resuming his role as president, backed by a coalition of pro-independence parties, but this has prompted warnings from the national government of further reprisals.