Spain's centre-right Popular Party (PP) has won a resounding victory in a parliamentary election dominated by the country's deep debt crisis.
With almost all the votes counted, the PP, led by Mariano Rajoy, is assured of a clear majority in the lower chamber.
The Socialist Party, which has governed Spain since 2004, has admitted defeat.
Mr Rajoy, who is expected to tackle the country's debts amid slow growth and high unemployment, said he was aware of the "magnitude of the task ahead".
He told supporters there would be "no miracle" to restore Spain to financial health, and that the country must unite to win back respect in Europe.
"Forty-six million Spaniards are going to wage a battle against the crisis," said the 56-year-old PP leader.
The PP won about 44% of the votes and the Socialists 29% in Sunday's election, according to near-complete official results.
The PP is expected to take about 186 of the 350 seats in the lower house.
As the results were announced, jubilant, flag-waving supporters danced outside party headquarters in central Madrid.
Socialist Party spokesman Jose Blanco congratulated the PP on its victory.
The BBC's Sarah Rainsford in Madrid says the right is headed for its biggest win since the end of the Franco dictatorship in 1975.
Parliament is expected to meet next month to confirm Mr Rajoy as the new prime minister.
The new government will have little time to show results and people are bracing themselves for a new wave of spending cuts, our correspondent adds.
Over the past week, borrowing rates have risen to the 7% level which is regarded as unsustainable. Unemployment stands at five million.
Miguel Arias, the Popular Party's campaign co-ordinator, said Spain was "going to make all the sacrifices".
"We have been living as a very rich country," he told BBC News.
"People are used to a very high level of public services and it takes time to them to acknowledge the realisation that we now are a poor country, that we have lots of debts and in order to pay them back we must reduce public expenditure and then we must recover the confidence of the markets."
Outgoing Socialist Prime Minister Jose Luis Rodriguez Zapatero was not standing again at this election.
His successor as party leader, Alfredo Perez Rubalcaba, has accused Mr Rajoy of planning severe cuts to health and education.
"Spain is at a historic crossroads," he told reporters in Madrid.
Correspondents say many are angry with the Socialists for allowing the economy to deteriorate and then for introducing tough austerity measures.
Spain's is the third Eurozone government in as many weeks whose fall has been attributed to the debt crisis.
The socialists in Greece and Silvio Berlusconi's Italian conservatives have also been swept from power.
Earlier this year, the governments of debt-stricken Ireland and Portugal also fell.