Spain's conservative Popular Party has signed a deal with the business-friendly Ciudadanos party that could pave the way for the formation of a new government and avert a possible third round of elections.
The parties signed a package of conditions set by Ciudadanos a day after parliament announced that Popular Party leader and acting premier Mariano Rajoy will put his candidacy to form a new government to a first vote on August 31.
However, the support of Ciudadanos alone will not be enough for Mr Rajoy to secure a majority in parliament and so far all other parties are saying they will vote against his attempt to form a government.
His party, in power since 2011, won a June election with 137 seats, 39 short of a majority in the 350-seat legislature. The Socialist party was second with 85 seats, the left-wing alliance Unidos Podemos was third with 71 seats and Ciudadanos fourth with 32 seats.
The June election followed a December ballot that failed to produce a government.
If the situation remains deadlocked two months after the August 31 vote, Spain would have to hold fresh elections on Christmas Day, a major family holiday.
The Popular Party and Ciudadanos are now piling pressure on the Socialist party, which has led most governments in Spain in recent decades, to at least abstain and snap the stalemate. But the Socialists insist they will vote "no".
In the first confidence vote, Mr Rajoy must garner an absolute majority of politician votes.
Failing that, he would face a second vote on September 2 in which he would only need more votes in favour than against.
Ciudadanos insists the deal is only for the investiture vote and that they will remain in opposition.