TUNIS, NOV. 7 -- President Habib Bourguiba, who led Tunisia to independence and ruled it with an iron hand for more than 30 years, was declared senile and then overthrown without a struggle today by a tough-minded former general who was his prime minister.

Zine Abidine Ben Ali, who immediately named himself president in Bourguiba's place, said he will open the way for political parties and other organizations to participate in running the country under "popular sovereignty." He pledged in a statement to install a "responsible democracy" in this North African country to replace Bourguiba's autocracy, but he stopped short of a specific promise to schedule elections.

The removal of Bourguiba, in addition to ending the reign of one of the Arab world's most enduring leaders, opened a period of uncertainty in a country noted for moderation and friendly relations with the United States and Europe as well as with fellow Arab countries.

Bourguiba, who is at least 84, was confined with a small entourage to his seaside mansion in Carthage on the outskirts of Tunis for most of the day following the predawn takeover, knowledgeable sources said. Soldiers backed by an armored personnel carrier blocked off approaches to the area.

But no resistance was reported and Tunis residents strolled in downtown streets tonight smiling and calm. Cafes were full of relaxed-looking men discussing the day's changes and there was little sign of additional security forces.

Bourguiba, who for some time had shown signs of suffering from his advanced age, seemed to act in a particularly erratic manner during the past week, informed diplomatic sources reported. After announcing the appointment of a new ambassador to the United Nations, for example, the president changed his mind a few days later as if nothing had happened.

Perhaps more important, these sources said, Bourguiba was said to be considering ordering a new trial for a group of Islamic militants who went before a special State Security Tribunal last September. Seven of the fundamentalists, alleged members of the Islamic Tendency Movement, were sentenced to death on charges of plotting against the state.

Bourguiba at the time was reliably reported to have sought a death sentence for at least 20 of those on trial, seeking to set an example for fundamentalist Tunisians opposed to the moderate Islamic state he has installed. The relatively small number of those sentenced to death then was seen as a victory for Tunisian officials who feared large-scale executions would sully the country's reputation and stir up more resentment against the aging president.

Against this background, Ben Ali announced this morning that he had organized a special commission of six doctors to render judgment on Bourguiba's ability to continue as president. The new government issued a communique in the commission's name in which the doctors said that after "evaluation" they decided "his state of health no longer permits him to carry out the functions of his office."

It was unclear whether the doctors actually examined Bourguiba, although some had been associated with caring for him in the past.

Ben Ali, announcing the takeover about 6:30 a.m., first paid homage to Bourguiba's role in winning independence from France in 1956 and fashioning Tunisia into a modern state. But then he made it clear that times had changed.

"Faced with his senility and the worsening of his situation, and based on the relevant {medical} report, national duty imposes on us to declare him to be in complete inability to assume the duties of the presidency of the republic," he said. "Given this, and applying Article 57 of the constitution, we take charge, with the help of the All Powerful, of the presidency of the republic and the supreme command of the armed forces."

Article 57 provides that the prime minister takes over if the president is incapacitated.

Ben Ali, 51, has spent almost all his career in intelligence and security. When he took over as prime minister last month, he kept his previous post as interior minister.

Educated as an electronics engineer, he was trained at France's St. Cyr military academy and, as a young officer, received intelligence and security training in the United States. Since his U.S. training, Ben Ali has been widely seen in Tunisian political circles as a U.S. favorite.

{U.S. and Tunisian diplomatic analysts in Washington suggested that, although Ben Ali is not well-known publicly, his background and his statements today hint that Tunisia's foreign policy will remain moderate and open to close ties with the West. "There hasn't been any major change in the people around him," one said. Observers noted that Ben Ali's reshuffled Cabinet comprises well-known figures of past governments and that the new foreign minister, Mahmoud Mestiri, has long served as the ministry's deputy chief.

{The State Department said, "We look forward to maintaining the traditional ties between the United States and Tunisia under its new government. We hope that calm will prevail during this period."

{The statement said "the United States values the years it has worked together" with Bourguiba, and offered no reaction to the declaration of his senility. Over recent years, U.S. and Tunisian officials have quietly accepted a broadly held view that Bourguiba was becoming unfit to lead.

{Tunisia's neighbors, Algeria and Libya, welcomed the takeover, as did France and Egypt, according to news agency reports.}

In taking over, Ben Ali strongly indicated a desire to see political life broadened after years during which Bourguiba grew increasingly intolerant of opposition. Since naming himself president for life in 1975, Bourguiba had made the question of his succession more complicated by preventing emergence of alternate leaders.

The constitution called for the president to be replaced by Bourguiba's handpicked prime minister, whom Bourguiba frequently changed, according to unpredictable whims.

Concerns about Bourguiba's health and fitness to rule had increased during the past 16 months. After six years of delegating authority to an anointed successor, Mohammed Mzali, Bourguiba fired him in July 1986. Apparently under the influence of a favorite niece, Saida Sassi, Bourguiba divorced his long-powerful second wife, Wassila. Political infighting within his palace entourage appeared to intensify, with Ben Ali seen as one of its rising stars.

Surprising many observers with his takeover, Ben Ali declared, "The era we live in can no longer stand for a president for life, nor an automatic succession to the head of the state from which the people finds itself excluded." "Our people are worthy of an evolved and institutionalized political life, founded really on multipartyism, plurality and mass organizations," he said.

Following those lines, Ben Ali pledged to propose soon to parliament new laws on political parties and the press.

The most prominent traditional political opposition to Bourguiba, the Movement of Democratic Socialists of former defense minister Ahmed Mestiri, endorsed Ben Ali's takeover and wished him "full success." In a statement, Mestiri's group called for an amnesty for politically connected prisoners and organization of "popular representation" in the government.

The only military officer dismissed was the Air Force chief of staff, Brig. Gen. Ahmed Naaman, who is Bourguiba's nephew. This was said by informed diplomats to be a sign that Ben Ali's move found approval among the military. A number of promotions were announced this afternoon.

But several of Bourguiba's closest advisers -- and possible rivals to Ben Ali -- were reliably reported to be under house arrest. These included Mohammed Sayah, a former education minister; Mansour Skhiri, a former transport and housing minister, and Habib Bourguiba Jr.

Bourguiba "will be invited to go to his palace in {his hometown of} Monastir with all the privileges of a former leader," said Oussama Romdhani, spokesman for the Tunisian Embassy in Washington.}