The centre-right Social Democrat-led Democratic Alliance beat the Socialist Party for the first time in eight years, but have little chance of forming a majority.