Spain's acting Prime Minister Mariano Rajoy said on Monday he hoped to form a government with broad support from rivals after his conservative party won the most votes in Sunday's fragmented election.

The People's Party (PP) made gains versus an inconclusive December ballot but the re-run still left it well short of a majority, forcing it to seek a coalition deal, or at the very least support from other leaders in confidence votes.

"I favour the notion of a stable government every four years which has a set policy programme, but if that's not possible we will have to govern doing things day by day," Rajoy told a news conference.

In a nod to the Socialists that came second in the election and fourth-placed party Ciudadanos (Citizens), the acting prime minister said he would reach out to "moderate" parties with whom they share common ground on issues such as Spanish unity.