MADRID — Spain was plunged on Tuesday into another round of political uncertainty after King Felipe VI announced that its main parties had failed to agree on who should lead the next government, forcing another national election in November.

Pedro Sánchez, the caretaker Socialist prime minister, blamed the other three main parties for failing to endorse him as the government’s leader, after he won a clear-cut election victory in April but did not gain a parliamentary majority.

It will be the fourth election in four years, underscoring how fragmented and polarized Spanish politics have become. In 2016, Spain spent 10 months in political limbo after two inconclusive elections, a sign of future fractures. In July, Mr. Sánchez lost a bid to take office amid feuding between the two major left-wing parties, the Socialists and Unidas Podemos, over a power-sharing agreement.

“I have tried by all possible means, but it has proved impossible,” Mr. Sánchez said Tuesday evening at a news conference, to explain why five months of negotiations had ended in failure. “Spain needs a government, but not any old government.”