Spain's Socialist leader and incumbent prime minister Pedro Sanchez has agreed to a single television debate with the lead candidates from three other main parties, following controversy over a potential debate appearance by a surging far-right party.

The Socialist party said Wednesday Sanchez will appear ahead of the April 28 ballot on public broadcaster RTVE with the leaders of the conservative Popular Party, center-right Citizens party and far-left Podemos party.

Sanchez had wanted a debate featuring the anti-immigrant Vox party, which is seeking its first parliamentary seats. Analysts say Sanchez wanted to associate the Popular Party and Citizens party with Vox, which previously have forged a regional alliance.

But the electoral board disallowed that five-way debate, ruling that other small parties would also need to be invited.