MADRID (Reuters) - Spain's divided Socialists will meet in the coming weeks to decide whether to allow their conservative rivals to stay in power and avoid a third election, the party's interim head said on Monday.

Spanish politicians on the right and left have until the end of October to overcome their divisions and form a government after two previous ballots in December and June delivered hung parliaments.

The center-right People's Party (PP) won the most votes in those elections but fell short of a majority. The Socialists came second in both ballots, with enough parliamentary seats to veto their rivals but too few to form a viable government of their own.

But the Socialists' interim manager Javier Fernandez - in charge after leader Pedro Sanchez was ousted on Saturday amid a bitter dispute over how to resolve the deadlock - said on Monday the party may take several weeks to define its stance.

Fernandez, who also presides over Spain's northern Asturias region, declined to say when senior Socialists would meet but said it would not be next weekend, the first possible date.

By forcing out Sanchez, the Socialists opened the door to ending Spain's nine-month deadlock, which has led to a legislative standstill and hampered efforts to get public finances on track.

Sanchez had spearheaded a confrontation with the PP and blocked its leader Mariano Rajoy's bid for a second term.

But the Socialist Party has to patch over deep divisions if it is to shift its line and enable a government by abstaining in a parliamentary confidence vote.

It faces either a third election that could further weaken its position after a string of poor results or the prospect of being derided as a stooge for the conservative party at a time when the far-left Podemos ("We Can") is biting at its heels.

"Right now any solution to forming a government in Spain involves the Socialists ... whatever we do will be problematic for the Socialists and will hurt us," Fernandez told a news conference, adding he personally thought a third election was the worst option.

Even if the Socialists can overcome their internal strife and decide to back the PP, some analysts say other obstacles further down the road could hinder negotiations to form a government.

"The Socialist Party's civil war has reduced significantly its negotiating power vis-à-vis the PP," said Antonio Barroso of Teneo Intelligence in a note. "The risk is that (Rajoy) will push for a deal that also includes a commitment from the Socialists to support his government's first budget."

(Reporting by Sarah White and Carlos Ruano; Editing by Janet Lawrence)