Spain's opposition Socialist party leader is traveling to Lisbon for talks with Portugal's Socialist prime minister, whose success he would like to emulate in forming a leftist coalition government despite having lost elections.

Spain's Socialists, led by Pedro Sanchez, came second in last month's election but have a chance of following their Portuguese counterparts in forming a governing so-called "coalition of losers."

Conservative acting Prime Minister Mariano Rajoy's Popular Party won the election but failed to get a majority and is having trouble finding support to form a government.

Portuguese Socialist leader Antonio Costa, whom Sanchez meets Thursday, also came second in recent elections but outflanked the incumbent center-right government that won by creating an leftist alliance that joined together to unseat the government and elect Costa premier.