MADRID (Reuters) - Spain’s acting premier on Wednesday lost a parliamentary confidence vote for a second term after he failed to win enough support from the opposition, bringing the country closer to a potential third election in a year.

Spain's acting Prime Minister and People's Party leader Mariano Rajoy reacts during an investiture debate at parliament in Madrid, Spain August 31, 2016. REUTERS/Juan Medina

Mariano Rajoy, of the centre-right People’s Party (PP), received 170 votes of support, falling short - as expected - of the minimum 176 needed to form a government. He needed the support of the Socialists, who voted unanimously against him, to win the required absolute majority.

Spain’s lack of a functioning government since inconclusive elections in June and December, and the resulting political deadlock, have stalled investment and there are signs it could be starting to limit a strong economic recovery.

Government bond yields rose sharply ahead of the vote, underperforming euro zone peers, as the possibility of more months of political impasse spooked investors.

Liberal newcomer Ciudadanos voted in favour of Rajoy, as did a small party from the Canary Islands region. The Socialists, anti-austerity alliance Unidos Podemos, and regional parties from the Basque Country and Catalonia voted against him.

Rajoy now faces a second vote on Friday in which delegates can abstain and a simple majority would suffice to allow him to form a PP-led minority government. He would need just 11 abstentions to win this second vote, but a loss is also likely if the Socialists do not cede.

If he loses Friday’s vote, Rajoy has two months to try to form a government before triggering another election, which could then could fall on Christmas Day.

Slideshow ( 4 images )

Socialist Party leader Pedro Sanchez says Rajoy is too tarnished by a long series of corruption scandals involving the PP and the austerity policies his PP government enacted during a deep recession.

SQUEEZE ON ECONOMIC RECOVERY

“The problem is that you are not a trustworthy person,” Sanchez said during a marathon series of speeches over two days by party leaders ahead of the vote.

In the preliminary speeches, Rajoy called on the Socialists to at least abstain in the vote in order for Spain to be able to form a government and to prevent a third election.

“Given the situation we are in, after two elections and the threat of a third election which you seem to want, I ask you to abstain,” Rajoy told parliament on Wednesday.

“We can’t keep on having election after election until there is an outcome for a government that Mr Sanchez likes.”

Rajoy told parliament he wanted to form a government with broad support that would be able to safeguard Spain’s economic recovery and play a leading role in the European Union.

There are some signs that the eight months of uncertainty are starting to dampen the economy. Investment in infrastructure dropped sharply in the second quarter and economists say growth rates, although among the highest in the euro zone, are being hampered by the lack of a central administration.

If Rajoy also loses in both votes this week, the focus will shift to regional elections on Sept. 25 in the Basque Country and Galicia.

The Socialists may be more open to negotiations once these elections are out of the way, as the party does not want to risk losing regional votes by allowing another PP-led government.

(The story has been refiled to add first name and affiliation of Socialist leader Sanchez in paragraph eight)