The leader of Spain's conservative People's Party (PP), Alberto Núñez Feijóo, proclaimed victory in Sunday's parliamentary election, but made no mention of plans to start coalition talks with far-right Vox.
He congratulated Vox leader Santiago Abascal on the party's strong showing in the election after the two parties secured a combined absolute majority.
The Socialist Party of Prime Minister Pedro Sanchez came second, and Sanchez has conceded defeat.
"It's a sad night for the country," Sanchez told supporters. "We recognize and accept the result ... but it doesn't mean we will succumb to passivity and despair."
Sanchez said his party would lead the opposition to any right-wing government.
With 99% of votes counted, the PP was projected to win 135 seats with Vox winning 52, according to the interior ministry. The ruling Socialists were projected to win 115 seats. A party or bloc needs 176 seats in the 350-member parliament to form a government. Voter turnout of 79.6% was the highest since 1982.
Further right-wing gains expected in additional European elections
The vote is the first of several European elections over the next year that could see far-right parties gain further ground, starting with France in April.
While negotiations between the PP and Vox over the distribution of government posts are expected to be difficult, the two parties already have experience of working together, having governed in coalition in four Spanish regions.
Vox backs tougher immigration controls and lower taxes while opposing climate policies and expanded LGBTQ rights.
Spanish Prime Minister Pedro Sanchez, who has governed with fragile minority coalitions since 2018, called an early election, saying he needed a majority after parliament rejected decrees he proposed to address a mounting housing crisis.
Democracy was restored in Spain in 1978, three years after the death of Francisco Franco, who ruled over the country for almost four decades after a brutal civil war from 1936 to 1939.
Coalition talks face no formal deadline before the first investiture vote, but if no candidate wins parliament's confidence within two months of that attempt, fresh elections are automatically triggered.
The PP says it would prohibit mass amnesties, allow for returns to third countries and introduce a points system for legal immigrants. Vox wants to deport convicted foreigners and give priority to Spaniards in the queue for housing.
Spain's Sanchez convenes party leadership after election defeat
Sanchez convened on Monday a meeting of his Socialist Party leadership to analyze their defeat in Sunday's election, a spokesperson told Reuters.
Sanchez, who has governed with fragile minority coalitions since 2018, has not clarified his future after the center-right People's Party won Spain's election.