Incumbent Spanish Prime Minister Pedro Sánchez told supporters that Socialist party winning the country's general election meant the "future has won and the past has lost."