Following a bullish anti-Madrid speech during a debate in the Catalan parliament, Torra won 66 votes against 65, with 4 regional lawmakers abstaining in the first round of voting.
However, the same result in the second round vote scheduled for Monday would be enough for him to be elected, as only a simple majority will be required.
The 55-year-old father-of-three is an independence advocate cut from the same cloth as Puigdemont, who is currently in exile in Germany fighting an arrest warrant and extradition request from Spain, but still exerting his influence on politics back in Catalonia.
Addressing parliament, Torra said he was "working tirelessly for the Catalan republic" and signalled that the secession crisis is far from over, even if Catalonia does finally get a government after months of political
"I want it to be clear that our president is Carles Puigdemont and we will be loyal to the mandate of October 1st to build an independent state in the form of a republic," Torra said, referring to last year's outlawed independence referendum.
He promised to restore Catalonia's laws suspended by Spanish courts and start drafting a constitution for a future Catalan Republic, stressing that he would "not give up anything" and would "assume responsibility for what comes from our actions".
Puigdemont would become involved as soon as his legal situation allowed, added Torra, who also condemned the "unacceptable silence" of European institutions over the Catalan crisis.
But he did say he was "ready to talk tomorrow without conditions" with the government of Prime Minister Mariano Rajoy.
Rajoy quickly responded to the speech, saying: "What we saw and heard did not please us... but we will judge his actions."
He also warned that under Article 155 of the constitution, which the government used to impose direct rule on Catalonia, "could be used again if necessary," if the next regional leadership did not respect the law.
The government also issued a statement calling Torra's speech divisive and accusing Puigdemont, in naming his successor, "of making first the interests of an individual rather than the general interest of all citizens."
The opposition accused Torra of throwing "oil on the fire".
"Independence lost a great opportunity today, (that of having) a candidate who recognises his errors," said Ines Arrimadas, leader of the centre-right Ciudadanos, the party that received the most votes in the last regional elections.
The head of the Catalan Socialist party Miquel Iceta criticised Torra for accepting to "subordinate" himself to "someone who believes he is the legitimate president", referring to Puigdemont.