Catalan pro-independence parties have failed for a fourth time to elect a regional leader.
Quim Torra needed 68 votes to be elected but obtained only 66.
They now have just ten days to form a government or face holding a new election.
But Torra has another chance in a second round of voting on Monday - as only a simple majority is needed in the regional parliament.
"Carles Puigdemont is our president. We will remain loyal to the mandate from October 1st, which is to build an independent state in the form of a Republic," Torra said after the vote.
Inés Arrimadas, the leader of Ciudadnos, the main pro-Spanish party in Catalonia, accused Torra of failing to compromise.
"He doesn't make any call to change course, any call to rectification or co-existence. He makes a call to clash, to have more confrontation," she said.
The central government in Madrid also accused Torra of being confrontational.
Catalonia has been in political limbo since December last year when pro-independence parties won early elections.
Madrid invoked special powers to take direct control of Catalonia in October after the region declared independence. The wealthy, populous region has been administered by the central government ever since.