Catalan separatists have inaugurated Quim Torra as president of the autonomous community, opening the way for the Spanish government to lift direct rule after six months of political deadlock.

Mr Torra promised to push forward with the independence project and “defend the Republic” as his investiture was approved by a margin of just one vote in the Catalan parliament.

But, in a nod to the political balancing act that Mr Torra faces, he also welcomed the prospect of dialogue with Mariano Rajoy, the Spanish prime minister. Mr Rajoy said he would receive the new president with “understanding and concord”, though added that he would not hesitate to act if the new Catalan government violated the law.

A controversial political activist, Mr Torra was handpicked by deposed leader Carles Puigdemont, who is expected to retain a decision making role from Germany as he fights extradition to Spain.

Mr Puigdemont, who Mr Torra yesterday insisted remained the “legitimate president”, has been accused of deliberately pursuing confrontation with his choice of successor. Mr Torra has already been forced to apologise for a string of six-year-old tweets expressing anti-Spanish sentiment, and was yesterday again accused of "racism and xenophobia" by opponents.

Inés Arrimadas, the Catalan leader of conservative party Ciudadanos, pointed to an 2012 article written by Mr Torra in which he described those in Catalonia who opposed the advance of Catalan language as “beasts with human form” who “drink hate”.