MADRID (Reuters) - Spain's Socialists, which came second in an election on Sunday after the conservative People's Party (PP), will not back acting Prime Minister Mariano Rajoy's re-election, spokesman Antonio Hernando said on Monday.

"We won't support Rajoy for the investiture nor will we abstain," Hernando said.

The Socialists could enable the forming of a PP minority government by abstaining in a vote of confidence in parliament to invest Rajoy as prime minister.

The PP emerged as the only major party to gain ground from inconclusive elections held last December, as voters flocked back to traditional parties and abandoned newcomers.

Separately, leader of the liberal Ciudadanos party Albert Rivera also said on Monday he would not back a government led by Rajoy.

(Reporting by Paul Day; Editing by Sarah White)