By Alison Roberts
BBC News, Lisbon
Portugal's Socialist Party has swept back into power after three years in opposition, with its biggest ever election win.
Jose Socrates triumphs - but the honeymoon may soon be over
The Socialists, who will need to act decisively to reinvigorate the ailing economy, secured 45% of the vote.
Outgoing Prime Minister Pedro Santana Lopes's centre-right Social Democratic Party secured just 28%, and its coalition partner for the past three years, the right-wing Popular Party, 7%.
In his victory speech, Socialist leader Jose Socrates pledged to restore confidence in the country and its institutions, but said little about his policy priorities.
Growth has been stalled for years, as governments have struggled to hold the public sector budget deficit to eurozone limits. There are also major state inefficiencies in areas from tax collection to healthcare that act as a drag on growth.
The single biggest factor in the Socialist win was the unpopularity of the incumbent administration.
Bario Alto, Lisbon: Portugal is in the grip of economic malaise
Mr Lopes took over as prime minister last July after Jose Manuel Barroso left to head the European Commission.
His term was dogged by internal squabbles, and he never convinced voters he knew how to relaunch a weak economy. In December, President Jorge Sampaio dissolved parliament, citing a failure to tackle Portugal's problems.
Turnout in Sunday's vote, at 66%, was four points higher than at the last general election. Voters had been urged to take part by President Sampaio, Portugal's most popular political figure.
The outgoing governing coalition had imposed wage freezes on public sector workers and other real cuts in spending, but for little obvious gain.
Economists warn that the new government may have to take similarly painful measures if it hopes to get the economy back on track and converging with the European Union average.
With the Communist Party reversing years of slow decline to add two seats to its existing 12, and the radical Left Bloc jumping from three to eight, Portugal has clearly shifted to the left.
In all, the left garnered 60% of the vote. Many Socialists see that as a sign the electorate is fed up with economic orthodoxy.
The PM's liberal policies failed to revive the economy
"The right tried the normal liberal ideas and failed completely," João Cravinho, a former Socialist minister and the party's top candidate for Faro, told the BBC.
"They tried to decrease the deficit, and the deficit increased by two points, to five percent. They tried to instill confidence, and all indicators fell."
Business leaders gave the new government a cautious welcome, and called on it to outline a plan of action.
"I see this absolute majority as a good thing, because the economic problems are great and there's a need for action," Ludgero Marques, president of the Oporto-based Portuguese Entrepreneurial Association, told Portuguese radio.
"The Socialist Party will be able implement measures needed to resolve problems that involve us all and that we must resolve quickly."
He echoed Mr Socrates' emphasis on restoring confidence, adding that this can only spring "from a competent government that we can see has the stuff of authority, able to engage in dialogue but also take action".
During the campaign Mr Socrates outlined some eye-catching measures, such as a one-off payment to 300,000 poor pensioners and a programme to place young managers in small businesses.
But he did not explain to economists' satisfaction how he proposed to achieve his declared goal of recovering the 150,000 jobs lost under the outgoing government.
The president is expected to ask Mr Socrates to form a government later this week, after calling in the leader of each political party with seats in the new parliament for talks, as required under the constitution.
Despite the fact that the election coincided with the referendum in Spain on the EU constitution, neither the EU nor foreign affairs got a look-in in the election campaign.
Like the Spanish, the Portuguese are strongly pro-European, having benefited not only economically from the EU since the country joined in 1985, but also politically, with the consolidation of democracy.
The outgoing government had promised to hold a referendum, but with Portuguese constitutional restrictions on the interval between a referendum and elections, and with local and presidential elections coming up in the next 10 months, many analysts say the idea may be quietly dropped.