MADRID—Spain lifted direct rule in Catalonia on Saturday after regional government leaders were sworn in, concluding an unprecedented attempt by Madrid to contain a separatist push that threatened to splinter the country.

Thirteen members of Catalonia’s regional government were sworn in during a ceremony in Barcelona, the capital of Spain’s Catalan region. Regional leader Joaquim “Quim” Torra, a hard-line separatist who was appointed in May, noted in a speech that while direct rule had ended, he and his government were “without...