TUNIS -- A trial of 90 Islamic activists accused of Iranian-inspired subversion has turned into an unwelcome test at home and abroad for Tunisia's increasingly contested leadership.

President Habib Bourguiba, the aging autocrat who led Tunisia to independence 31 years ago, has told recent visitors he plans to "exterminate" a group of Moslem fundamentalists who have challenged the country's traditional tolerance and western orientation. Diplomatic and Tunisian sources said he regards the month-long trial as a key step to demonstrate that resolve and to prevent Iranian-style extremism from spreading to Tunisia.

Prosecutors have asked the State Security Court to impose the death penalty on all 90 defendants, charging they plotted to overthrow Bourguiba's rule and replace it with a fundamentalist Moslem system. Tunisian officials, responding to criticism, said a tough verdict is necessary to preserve the moderate style of Islam that Bourguiba has nurtured here and the friendly western ties on which the economy depends.

Tunisian dissidents and some diplomatic observers warned, however, that executing even as many as 10 or 20 of the leaders could have the opposite effect, stirring up more resentment among disaffected youths. One prominent Tunisian dissident said the trial is the culmination of a "hysterical campaign" generated by Bourguiba's unwillingness to tolerate political opposition, Islamic or secular.

The five-man State Security Court has been deliberating its verdict since Monday, stopping to recall several witnesses for further testimony. {A verdict could come Saturday, according to defense lawyers cited by The Associated Press.}

Observers suggested that the court may be hesitating before delivering a verdict, wanting to counter criticism by displaying extra fair play. They noted that it provided a chance to reconsider whether the harsh verdict sought by the government really is a good idea.

The government says it has arrested 1,270 fundamentalists since beginning a crackdown in March against the main fundamentalist group, the Islamic Tendency Movement. Tunisian human rights advocates estimated that 1,800 have been arrested, with 1,400 of them sentenced to prison.

The government acted against the group and broke relations with Iran in March after French investigators said Tunisians in Paris had been recruited by Iranian agents there setting up a terrorism support network.

The Foreign Ministry, which expelled Iran's diplomats, said they also were encouraging subversion within Tunisia, suggesting they worked through the Islamic Tendency Movement. The Iranian charge d'affaires, Ahmed Kanani, previously had been a Revolutionary Guard assigned to promote Iranian-backed militias in Lebanon, officials said.

Government officials have linked the Islamic Tendency Movement to Iran for years, but the group's leaders have regularly denied such ties and have disavowed any use of violence. The government has ignored the group's request to be licensed as a legal political party.

The government's campaign against Islamic dissidents also has fit into similar if smaller-scale repression against secular dissidents outside the ruling Destourian Socialist Party.

A trade union federation that mounted a political challenge to the government was purged, for example, and its leadership was replaced with government supporters. The main union leader, Habib Ashour, was jailed for a time and has been under a form of house arrest since his release last summer.

Ahmed Mestiri, a former defense minister who heads the Movement of Socialist Democrats and is Bourguiba's most prominent secular critic, was sentenced to four months in jail for leading an unauthorized demonstration in April 1986 against the U.S. bombing of Libya. Despite the sentence, he has been allowed to remain free.

Similarly, Khemais Chamari, a Mestiri ally and secretary general of the Tunisian human rights league, has been charged with spreading false news and defaming public order by making accusations against the government. His trial is scheduled for Oct. 7.

"The repression is a heavy argument in the hands of the extremists," Mestiri said in an interview. "When there is no political debate, of course that only favors the Islamic fundamentalists."

Mestiri and well-informed diplomats here predicted that Bourguiba's crackdown on the Islamic Tendency Movement is unlikely to prevent more sporadic violence by religious and political radicals unable to express dissent in authorized political channels.

Diplomatic and Tunisian observers said Bourguiba, who is at least 84 and reportedly has failing powers of concentration, has confused the Islamic fundamentalists with other political challenges over the years, believing that if he crushes the leaders the opposition will fade.

"His computer does not register anything new any more," said one observer. "He does not live in the present. He lives in the past."

This has become particularly acute since Bourguiba, feeling stronger after a period of particularly diminished abilities, has pushed aside formerly close advisers and increasingly concentrated power in his own hands, these informants said.

One of the advisers, former prime minister Mohammed Mzali, was dismissed in July 1986 and sentenced in absentia in April to 15 years in prison. He has taken up exile in Switzerland.

Aside from the call for death sentences, procedures followed in the current trial have drawn sharp criticism from Tunisian and foreign human rights advocates, including Amnesty International. The court president, Heshmi Zammel, also holds the office of government prosecutor, they noted, and some of the defendants have exhibited what they said were cigarette burns on their chests inflicted during interrogation that included torture.

"That's why to speak of this trial as a regular trial is a little daring," said one diplomat.

The Islamic Tendency Movement leader, Rashid Ghannouchi, is among the 53 defendants awaiting the verdict in their cells. The other 37 either are hiding in Tunisia or traveling abroad, officials said. They are being tried in absentia.

Ghannouchi and others, charged with sedition and other crimes in the alleged plot, have acknowledged their desire to see Tunisia follow a more rigorous form of Islam, but have denied complicity in the specific crimes.