King Felipe VI of Spain has tasked acting Prime Minister Pedro Sánchez with forming a new government, after a new round of consultations with party leaders, lower house President Francina Armengol said in Madrid on Tuesday.
The lower house has to now schedule a vote. Sánchez said he "happily" accepts the task.
The prime minister added that for Wednesday he plans to start talking about the "relaunch of a progressive government."
Sánchez had been expected to be asked to form a government after parliament rejected an attempt by Alberto Núñez Feijóo, head of the opposition conservative People's Party (PP), to put a majority coalition together.
While he is thought by observers to have a better chance of success, Sánchez faces a difficult task.
He needs the votes of two Catalan parties, the leftist ERC of the head of the regional government of Catalonia, Pere Aragonès, and the conservative Junts of separatist leader Carles Puigdemont, who lives in exile in Belgium following a failed attempt by the region to break away from Spain in 2017.
Sánchez has until November 27 to form a viable coalition, after which fresh elections will have to be held on January 14.
Apart from the domestic political stasis, Spain's EU presidency up to the end of December is being overshadowed by the political uncertainty.