MADRID — Spain’s Parliament on Wednesday handed a defeat to the leader of the Socialist party in the first round of his long-shot attempt to become the country’s next prime minister.

Even though the party leader, Pedro Sánchez, will get another opportunity on Friday, when Parliament will hold a second round of voting, the result is likely to be the same. In turn, that would then raise significantly the likelihood of new elections in June to help break the deadlock among four main parties — the outcome of the last election just a few months ago.

Mr. Sánchez won 130 votes on Wednesday, short of the 176 votes that he needed to form a majority coalition. His votes came from lawmakers from his own Socialist party, as well as those of Ciudadanos, or Citizens, a center-right party that recently reached a coalition deal with Mr. Sánchez.

But conservative lawmakers from the Popular Party of Mariano Rajoy, the incumbent prime minister, as well as those from the left-wing Podemos Party, led the voting against Mr. Sánchez.