Spain's Socialists win EU ballot, local vote fragmented

* Socialists top vote in EU election

* Spain targets top EU jobs

* Local vote fragmented, tricky negotiations loom (Adds detail on regional election)

By Belén Carreño and Ingrid Melander

MADRID, May 26 (Reuters) - Spain's Socialists won most votes in European and local elections on Sunday in a series of ballots that boosted their ambitions to target a top EU job in Brussels but highlighted how deeply fragmented the political landscape is at home.

After winning national elections in April without a majority, the acting prime minister, Pedro Sanchez, was looking to Sunday's local, regional and EU elections to reinforce his negotiating stance to form a government.

On the EU front, the Socialists scored a strong win.

Sanchez' PSOE party topped the European election and was on course to have the biggest contingent in the EU assembly's Socialist group.

On the local front it is more complicated. The Socialists won more votes than any other party nationwide but the election was very fragmented and conservatives and the center-right and far-right together were set to win in key cities and regions like Madrid.

This set the stage for complicated talks to form governments both at local and national level.

Sunday's election "confirmed that the Socialists are, by far, the first political force in Spain," Sanchez said at a news conference, talking of his "pride" over the EU result.

Turning to local and regional elections, Sanchez reached out to the center-right Ciudadanos and conservative People's Party (PP), urging them to strike deals with his party rather than with the far-right Vox.

"I appeal to the responsibility of national political leaders not to leave the stability of municipal and regional governments in the hands of the far right," he said.

The outcome provides a more mixed picture than the April 28 general election, said political sciences professor Pablo Simon. He said the Socialists could be happy with their wins but that PP had won some oxygen, while Ciudadanos failed to consolidate their claim to be the main opposition party.

With more than 99% of the votes counted, the Socialists had scored nearly 30% in the municipal elections. PP came in second with just over 22%.

Voting in Barcelona, Spain's second-largest city, also was very fragmented. The ERC separatist party came first but it was unclear who could form a majority to rule the municipality.

Regarding regional elections, the Socialists overall improved or maintained their score but will also need to strike alliances to govern.

TOP EU JOB?

The Socialists won 20 seats in the European Parliament, PP 12, Ciudadanos seven and Vox three.