President Ahmed Sekou Toure of Guinea died Monday after an emergency heart operation at the Cleveland Clinic in Ohio. The death of the 62-year-old leader removed from the African scene the continent's second-longest surviving head of state from the heady days of the 1950s and 1960s when most the continent's former colonies made the rapid transition to independence.

Mr. Toure's rise to power in 1958 as the leader of Guinea-Conakry's painful plunge into independence from France was as controversial and mercurial as the autocrat's 26 years of iron-fisted rule were turbulent.

Louis Lansana Beauvogui, Mr. Toure's prime minister since 1972, was appointed interim president yesterday by the political bureau of Guinea's ruling Democratic Party. His appointment was to run during a 40-day period of national mourning.

A high-level State department official said Beauvogui "has the confidence" of the Democratic Party and "is likely to keep in place Mr. Toure's policies." The official said Beauvogui, who survived as Mr. Toure's deputy by keeping a low profile, "has a good chance to be a unifying factor for the short term" but that "it is too early to tell what will happen in the long term."

Mr. Toure had been flown to Cleveland Sunday after four doctors from the clinic, who had examined him in his homeland, determined that medical facilities there were not adequate to treat him.

The doctors had gone to Guinea at the request of King Hassan II of Morocco, who also secured a flying cardiac intensive care unit from Saudi King Fahd to transport Mr. Toure to the United States.

At the clinic, doctors diagnosed his condition as an aneurysm of the aorta caused by arteriosclerosis. Surgeons replaced the entire aorta, but Mr. Toure died on the operating table about five hours after surgery began, hospital officials said.

A ruthless ruler who accepted little dissent and no challenges to his rule, Mr. Toure was widely admired in Africa by militants for his often stormy denunciations of the West and by a long list of imperialist plotters that later came to include one of his erstwhile allies, the Soviet Union. His years in power, however, were marked by Guinea's economic paralysis and by bloody purges in reprisal for countless "plots" against his rule. The last massive reprisal was carried out in 1976 against the Fulani population of 1 million, the largest of Guinea's ethnic groups.

A broad-shouldered, handsome man of 36 years at the time of independence, Mr. Toure took his small West African nation along his own trail of pan-African socialist revolution and Stalinist-like terror that included a 13-year period of isolation of the country from the African and world community.

As he mellowed in the mid-1970s, Mr. Toure, a charismatic politician and mesmerizing speaker, began to loosen his grip on the affairs of his country's 6 million people.

One of the founders of the Organization of African Unity, Mr. Toure gradually opened the country to international contacts and pushed himself forward as an effective mediator in a number of regional conflicts, such as Chad's civil war and the guerrilla insurgency against Morocco in the western Sahara. A devout Moslem all his life, he played a leading role in having Egypt invited to rejoin the 42-nation Islamic Conference Organization earlier this year. Egypt had been suspended after the signing of the peace treaty with Israel in 1979.

Mr. Toure's proudest moment--one to which he made repeated reference for the rest of his life--came when he convinced his countrymen in 1958 to vote "no" to the late French President Charles de Gaulle's profer of partial autonomy in a French community controlled from Paris.

"We prefer poverty in liberty to riches in slavery," Mr. Toure said at the time.

In reaction, and as a warning to other French-speaking territories, the French pulled out of Guinea over a two-month period, taking everything they could with them. They unscrewed lightbulbs, removed plans for sewage pipelines in Conakry, the capital, and even burned medicines rather than leave them for the Guineans.

A year before the climatic break, Mr. Toure had established himself as the undisputed leader of Guinea when his Democratic Party, with a militant trade unionist and national peasant constituency, decisively defeated two ethnic-based, elite political parties in elections by capturing 57 of the 60 seats in the territorial assembly. In the first two years after independence, Mr. Toure allowed at least the rudiments of debate and dissent on government policies.

A plot to overthrow him, discovered in 1960, was the beginning of Guinea's long period of government-inspired terror. Matters worsened after a November 1970 invasion force of about 300 Guinean soldiers landed in a night assault on Conakry from Guinea-Bissau, which was controlled at the time by Portugal. The Portuguese-backed invasion failed to topple Mr. Toure.

Using as an excuse numerous "plots" he said were hatched in other countries, including France, the United States, the Soviet Union and China, Mr. Toure took firm control of the government, violently repressing even the mildest dissent and emasculating the trade unions, his own pre-independence power base.

At least 10,000 people have been rounded up since 1970 and 2,800 have "disappeared," according to the London-based human rights group Amnesty International in a 1982 report.

"Many are believed dead as a result of execution, torture, deliberate starvation and inhuman prison conditions," the orgnization reported. A fifth of Guinea's population is estimated to have fled into exile to the neighboring Ivory Coast, Sierra Leone, Senegal and other parts of West Africa.

Asked about the Amnesty charges in an interview last year in his presidential residence, Mr. Toure sidestepped the question during one of his usual nonstop, hour-long monologues. "Our concept of human rights is far ahead of human rights practices in countries claiming to be civilized," he said.

Former Senegalese president Leopold Senghor, with whom Mr. Toure had a stormy relationship for two decades until a 1978 reconciliation, yesterday summed up the Guinean leader in his comments to the French news agency.

Senghor described Mr. Toure as "a complex, intelligent, patriotic man, a man who loved Africa passionately," but a man whom history also would remember for "the thousands of Guineans who died in terrible conditions" as a result of the "bloody dictatorship he exercised over Guinea for two decades."