TUNIS - Tunisia's parliament speaker narrowly survived a confidence vote on Thursday, but his slim margin of victory may only deepen the country's political divisions after the resignation of the prime minister.

Some 97 members of parliament voted against Rached Ghannouchi, veteran leader of the moderate Islamist Ennahda party, falling short of the 109 needed to oust him.

However, with Ennahda and the conservative Karama party boycotting the vote to show their opposition to the motion, only 16 MPs gave him formal support.

Ghannouchi's narrow margin of victory may indicate that Ennahda will now face fiercer opposition in parliament from parties that voted against him, potentially complicating efforts to agree on a new government.

The vote comes two weeks after Tunisia's government collapsed less than five months into its term following corruption allegations against the prime minister, which he denied.

Both the confidence vote in Ghannouchi and the collapse of the short-lived government stem from an election last year that produced a deeply fragmented parliament in which Ennahda, as the biggest party, won only a quarter of the seats. 

President Kais Saied, a political independent who won a separate election in a landslide last year, has nominated a new candidate for prime minister who must now propose a government that can win majority support in the divided parliament.

The political crisis has come at a difficult moment for Tunisia, where the global pandemic has crashed the economy just as the government was seeking to agree on reforms aimed at reducing public debt while boosting growth and creating jobs.

(Reporting By Tarek Amara, writing by Angus McDowall, editing by Susan Fenton) ((angus.mcdowall@thomsonreuters.com; Reuters Messaging: angus.mcdowall.thomsonreuters.com@reuters.net))