0901 GMT May 22, 2018
Torra, handpicked as presidential candidate by deposed, exiled leader Carles Puigdemont, scraped through a parliamentary vote in which 66 separatist lawmakers voted for him, 65 non-independence MPs against and four abstained, AFP reported.
"We will build a Catalan republic," he said in a brief speech after the vote, after which lawmakers sang Catalonia's anthem "Els Segadors" ("The Reapers" in English).
The 55-year-old father of three pledged to respect the result of an independence referendum held on October 1 despite a court ban and said he would fight to "build an independent state in the form of a republic".
Catalan separatist authorities said 90 percent of the 2.2 million people who cast their ballot in the referendum – out of 5.5 million eligible voters – opted to break from Spain.
Prime Minister Mariano Rajoy called for "understanding and harmony" but warned that he would not tolerate any breaking of the law and Spain's constitution.
Torra's appointment paves the way for a new government after months of political limbo.
This in turn will lift a state of emergency direct rule imposed by Madrid on October 27 after the majority separatist parliament made a short-lived unilateral declaration of independence.
Analysts warned the road ahead would be a rocky one, however, with politicians and voters split on the merits of trying to leave Spain.