MADRID — Spain’s political quagmire showed no signs of being resolved Monday after a regional election gave a small boost to Prime Minister Mariano Rajoy’s conservative Popular Party, but failed to dispel doubts over whether he can form a new national government.

Rajoy has been heading a caretaker government for almost a year after two inconclusive elections in December and June. His party won the most seats in both, but lacks enough support in Parliament to form a government. Spain has never had a coalition government, and the country’s main political parties are finding it near impossible to negotiate deals with opponents. Parliament has until Oct. 31 to form a government or the country will face its third election in a year.

The Popular Party won local elections in the Galicia region Sunday, but a victory for the Basque Nationalist Party in Basque elections dampened hopes that Rajoy might be able to do a support-exchange deal with that party at the national level and possibly form a government.

His party and others were to hold meetings separately Monday to analyze the results.

As expected, the two regional elections dealt severe blows to the leading opposition Socialists, an outcome that is likely to increase pressure on its 85 lawmakers to change tactics and abstain in a future investiture vote in the national Parliament, allowing Rajoy to form a minority government.

But leader Pedro Sanchez ruled that out Monday and said that should Rajoy be unable to win Parliament’s confidence, he intended “trying to form an alternative government for change” with other non-conservative parties.

He also proposed putting the party leadership up for contest next month in an open challenge to his party critics.

Rajoy has the support of 170 lawmakers in the 350-seat national Parliament — 137 of them from his own party. But he is still six short of the majority needed to form a government.

The Basque Nationalist Party holds five seats, but Sunday’s regional victory removed the need for the party to do a deal with Rajoy.