BARCELONA, Spain — Lawmakers in Catalonia on Monday narrowly elected a separatist as president, but one not under indictment by the Spanish authorities, potentially easing the political deadlock with the central government in Madrid, though not resolving it.

The separatist, Quim Torra, will replace Carles Puigdemont, who is now fighting extradition from Germany after refusing to be prosecuted in Spain on charges of rebellion and misuse of public funds for carrying out a referendum on secession last October.

The referendum descended into chaos and violence after Madrid sent police forces from other regions to try to block a vote that had been declared unconstitutional. Mr. Puigdemont and other Catalan separatists nonetheless called the referendum a success, saying the measure had passed overwhelmingly, even as the vote had clearly left Catalonia painfully divided.

After Catalonia’s Parliament declared independence, Prime Minister Mariano Rajoy suspended the region’s autonomy and imposed direct rule from Madrid, using his emergency constitutional powers. He then called new regional elections in hopes of reshuffling the political deck.