By Lisa Barrington and Laila Bassam

BEIRUT (Reuters) - Lebanon's former prime minister Saad al-Hariri said on Thursday he would back Michel Aoun, a Hezbollah ally, to be president, a move that faces significant opposition but could help resolve a political crisis if it wins support from all the main factions.

Backing Aoun, a foe of his own Future Movement, is a gamble for Hariri, Lebanon's leading Sunni politician, but one that could ease the deadlock in Beirut and make him prime minister, restoring a political position shaken by financial woe.

"This decision comes from the need to protect Lebanon and the state and the people ... but it is a decision that depends on agreement," he said in a speech, describing Aoun as "the only option left".

Hariri and Aoun must now attempt to rally enough support to gather a quorum of parliament members, two thirds of the total, for a vote at the next scheduled sitting on October 31.

Aoun's candidacy is opposed by the parliament speaker Nabih Berri, leader of the Shi'ite Amal movement, which is also an ally of Hezbollah, by some of Hariri's own supporters, and by others.

Four prominent members of Hariri's Future Movement bloc in parliament, including former prime minister Fouad Siniora, told reporters they would not vote for Aoun. Telecom Minister Boutros Harb, an ally of Hariri's from a different party, said the same.

Still, the endorsement by Hariri, who has long opposed Aoun's Shi'ite ally Hezbollah, but has been politically weakened in recent years, represents an important attempt to break the prolonged standoff between Lebanon's political leaders.

Lebanon has endured a protracted political crisis since parliament failed to elect a new president more than two years ago, paralyzing government, causing a breakdown in many basic services and raising fears of future unrest.

Aoun said at a televised news conference that the agreement represented an attempt to heal national divisions and "restore political unity".

Hezbollah, Lebanon's most powerful political player, released a statement welcoming moves to fill the presidency but without committing to any wider power sharing agreement.

POWER SHARING

Parliament will convene on Oct. 31 for a session to elect the president, the 46th such sitting since the term of the last president, Michel Suleiman, expired in 2014, each of which failed to gain the two-thirds quorum needed for a vote.

Under Lebanon's power-sharing arrangement among its main sects, the presidency is reserved for a Maronite Christian, the premiership for a Sunni Muslim and the speaker of parliament for a Shi'ite.

The last parliamentary election took place in 2009 and later scheduled ones were postponed because of a failure by the sitting parliament to agree on a new electoral law.

Aoun, a former army commander in his 80s, led one of two rival governments during Lebanon's 1975-90 civil war before the Syrian army forced him into exile. His main Christian rival for the presidency, Samir Geagea, endorsed him earlier this year.

Hariri, 46, son of the former prime minister Rafik al-Hariri who was assassinated in 2005, leads the "March 14" alliance against Hezbollah and its allies, which toppled his earlier administration from 2009-11 by resigning from it en masse.

Lebanon's political fractures have been deepened by the war in neighboring Syria, in which Hezbollah has militarily supported President Bashar al-Assad.

Hariri has accused Assad of being behind his father's death, and gave evidence to an international court trying Hezbollah members charged with involvement in the killing. But he has also said he is prepared to share power alongside his rivals.

The former prime minister's position as Lebanon's leading Sunni politician has been shaken, however, by a financial crisis at his Saudi-based construction business, raising concerns he may have lost the support of the wealthiest Sunni Arab state.

(Additional reporting by John Davison and Ellen Francis; Writing by Angus McDowall; Editing by Richard Balmforth and Dominic Evans)