Portugal's governing centre-right coalition has won the country's general election, which was widely seen as a referendum on four years of austerity.
Socialist leader Antonio Costa admitted defeat and congratulated Prime Minister Pedro Passos Coelho.
With almost all votes counted, the centre-right leads with about 37%, with the Socialists on just over 32%.
However, Mr Passos Coelho said his coalition appears to have lost its absolute majority in parliament.
He indicated that he was ready to talk to other parties in the next parliament to pursue the "necessary reforms" he wants to implement.
Parties to the left of the Socialists seem to have achieved their best-ever result, says the BBC's Alison Roberts in Lisbon.
Four years of austerity have taken their toll, and the coalition lost almost one third of the votes that its two constituent parties gleaned in the last general election, our correspondent adds.
The coalition had vowed to continue the policies, in place since 2011 after it was forced to seek a eurozone bailout.
Unemployment has been falling for two-and-a-half years, but many regard the recovery as fragile.