The death of Guinea Bissau President Malam Bacai Sanha will be a stress test for the coup-prone West African state, which has made modest gains in stability in recent months after decades of turmoil.

The 64-year-old leader died on Monday in a Paris hospital after a long illness, raising fears of a violent power struggle in a country that has become notorious as a transhipment point for South American cocaine bound for Europe.

His death came two weeks after a clash in the capital Bissau between rival military factions, casting an extremely unstable country into further uncertainty, Martin Roberts of forecasting firm IHS Global Insight said on Tuesday.

Under the constitution, elections to replace Sanha are due in 90 days. A mediation effort is underway to soothe tensions between rival groups in the restive army, which has a history of meddling in politics in the former Portuguese colony.

National Assembly President Raimundo Pereira is meant to serve during the pre-election interim, but the country's opposition coalition has already rejected him as unsuitable and has threatened to stage protests.

The Democratic Opposition wants to tell all Guinea Bissau citizens that it opposes the nomination of Raimundo Pereira as interim president, it said in a press release on Tuesday, claiming Pereira stifled dissenting political voices during a previous stint as interim president in 2009.

Over the last few years U.S. and European intelligence and security services have focused more attention on West Africa's Atlantic seaboard to counter cocaine-trafficking, illegal migration and the southward creep of militant Islam.

There have been fears of small, impoverished Guinea Bissau turning into a narco state at the mercy of drug cartels.

The West African regional bloc ECOWAS and U.N. Secretary General Ban Ki-moon called for a peaceful transition in Guinea Bissau, and the U.S. State Department warned citizens of an increased risk of unrest.

The president of neighbouring Senegal, Abdoulaye Wade, said he feared renewed infighting and he invited disputing factions to mediation talks.

President Blaise Compaore of Burkina Faso has also accepted an invitation by the African Union to serve as mediator.

They might succeed in working out a deal (...) whereby rivals of yesterday work together. This will probably be the only way of bringing lasting peace, said Lydie Boka, head of risk consultancy StrategiCo.

ARMY HOLDS KEY

Sanha is the fourth elected president in Guinea Bissau in a row to fail to complete his term. He came to power in elections set after his predecessor Joao Bernardo Vieira was shot dead by rebellious soldiers in March 2009.

Sanha's prime minister, Carlos Gomes Junior, has effectively been running the country since the late's president's departure for treatment abroad, and has managed to draw in donor funds, advance army reform and win a key military ally in General Antonio Indjai, the armed forces chief.

Gomes is likely to seek to replace Sanha in the upcoming elections, but is expected to come up against rivals including former president Kumba Yala, who enjoys support from fellow ethnic Balanta who traditionally dominate the military.

There is little doubt that the successful candidate will have to be approved by the army chief Indjai as the military holds the real power, Roberts of IHS Global said.

Gomes and Indjai appear to have strengthened their position in the country after their main rival, Navy Chief Bubo Na Tchuto, was arrested in the wake of a street battle on December 26 which Gomes said was a foiled coup attempt.

Gomes has also won favour with international donor nations by announcing a crusade against narcotics smuggling, and requesting U.S. and European help to stamp out trafficking.

Drug-trafficking gangs are attracted to Guinea Bissau's jigsaw coast of islands, creeks and coves, which provides secluded drop-off spots beyond the reach of weak local law enforcement. Senior military figures are believed to be involved, diplomats and security sources say.

The recent unrest in Guinea Bissau broke an unusual quiet spell in the country during which Angola promised millions of dollars in aid to fund army reform and the Paris Club of creditor countries canceled more than $250 million (161.4 million pounds) in debt.

Guinea Bissau's main export is cashew nuts, but Angola is seeking to develop a bauxite mine.

(Writing and additional reporting by Richard Valdmanis)