MADRID (Reuters) - One of the founders of Spain’s anti-austerity Podemos party, Inigo Errejon, gave up his seat in parliament on Monday, sending the movement - a key ally of the ruling Socialists - into disarray months before regional and municipal elections.

Podemos (We Can) party member Inigo Errejon, now running under the coalition Unidos Podemos (Together We Can), remarks on partial results after polling stations closed in Spain's general election in Madrid, Spain, June 26, 2016. REUTERS/Andrea Comas

Internal divisions in the far-left Podemos, whose support is instrumental for the survival of the minority center-left Socialist government, could spell problems for Prime Minister Pedro Sanchez. He came to power last June after ousting a conservative government and faces a general election next year.

Formed in 2014 in response to a near five-year economic slump during the financial crisis, Podemos won 21 percent of the vote in the 2016 general election.

“Today I hand in my seat as lawmaker. It has been an immense honor. I give thanks to all with the pride of knowing that I tried my best. Now I only have one task: to obtain a new majority in Madrid,” Errejon wrote on Twitter.

Errejon, who was second in command in Podemos’ first few years, has announced that in next May’s election he would run for presidency of the Madrid region as part of an open political platform on the same ticket as Madrid mayor Manuela Carmena.

The move appeared to signal a complete break-up with Podemos leader and Errejon’s once close friend Pablo Iglesias.

Errejon, who is considered more moderate than Iglesias, has not officially left Podemos, which now has to decide whether to nominate a new candidate for the Madrid election.

“In such a volatile environment in Spanish politics the division could benefit rivals,” said Lluis Orriols, political science professor at Madrid’s Carlos III University.

He said the Socialists would probably consolidate their position as the main leftist party, but the left as a whole could become more divided and lose support.

Recent polls have shown premier Sanchez’ Socialists would win a general election but would need Podemos’ support to clinch the premiership.

Podemos members acknowledge the rift could hurt the party, but hope to overcome the divisions before next year’s election.

“There’s still a lot of time until the general (ballot) and there’s still a chance for the party to rebuild itself,” said Hugo Martinez Abarca, a Podemos regional lawmaker for Madrid.