Rebels and forces loyal to President Ali Nasser Mohammed both claimed to be gaining control of South Yemen yesterday as foreigners evacuated by ship reported new fighting and said that the week of civil war had "absolutely devastated" Aden, the capital of the strategically situated Soviet ally on the Arabian Peninsula.

Mohammed was reported by several sources to be somewhere in South Yemen after a weekend flight to Ethiopia, and official sources said he had spoken by telephone with the leaders of Algeria, Libya and Syria in an effort to gain backing against the Marxist hard-liners attempting to overthrow him.

The Soviet Union, which uses the Arab world's only Marxist state as its sole military facility in the region, published an appeal from South Yemeni Prime Minister Haidu Abu Bakr Attas for an end to the fighting. Attas, who was in New Delhi when the fighting began, has been in Moscow since Thursday.

But the Soviets, faced with a civil war in which both sides profess allegiance to Moscow, have cautiously avoided taking sides. Agence France-Presse reported from Moscow that Attas was received by Yegor Ligachev, the Soviets' number two party official, rather than by his governmental counterpart, in what diplomats said was a clear message that for the time being Moscow was not fully recognizing him as prime minister.

The fighting began last Monday, after an apparent shootout at a Politburo meeting between supporters of Mohammed, a Marxist who has angered hard-liners by his willingness to deal with pro-West Arab neighbors, and former president Abdul Fatah Ismail. Ismail reportedly wanted to return South Yemen to the doctrinaire Marxism it followed before he was forced to resign in 1980.

A radio broadcast using the frequency of the official Radio Aden charged yesterday that Mohammed had sent presidential guards to the Politburo meeting last Monday to murder his opponents, the Associated Press reported. According to this account, a shootout erupted that killed two party members, and Mohammed fled the country. Radio Aden had said last week that four rebel leaders, including Ismail, had been executed after an attempt to assassinate Mohammed. But there have been reports since then that Ismail is still alive.

International communications with South Yemen remained cut yesterday. Accounts of the situation there came from foreigners evacuated to Djibouti, across the Gulf of Aden on the Horn of Africa, from Arab diplomatic sources and from rival radio stations claiming to represent the government.

Robert Bridges, captain of the British frigate Jupiter, which brought 200 foreigners to Djibouti yesterday to bring the total evacuated to nearly 3,500, said that when he left Aden Sunday night, the city's center and eastern zone were under the control of government troops while the northern district and Little Aden, in the west, appeared to be in rebel hands.

Bridges told reporters that on Friday night "there were great fires at the refinery at Little Aden and oil storage tanks all ablaze and heavy artillery duels at the airport."

Frances Scaddan, wife of the British consul in Aden, said in Djibouti that "Aden is absolutely devastated. Everything has either caught fire or been shelled."

An Iraqi evacuated by a Soviet ship said, "Corpses and soot-covered, wrecked tanks were all over the city when we left Saturday." Other evacuees described the city of 50,000 people as a "ghost town," with water and electricity shut off and food stores closed.

In a brief report from Kuwait yesterday, the official Soviet news agency Tass said armed clashes in South Yemen continued in the previous 24 hours "though on a smaller scale than before."

Al Ittihad, a semiofficial newspaper in Bahrain, reported that "a large number of Soviets" were among the casualties in the fighting. About 2,500 Soviets, including 1,500 military advisers and other technicians, have been evacuated from Aden so far.

Some reports have put the total number of dead and wounded at 9,000 to 10,000 in the week of fighting, but there has been no way to confirm the figures.

Sources in North Yemen, a moderately pro-West neighbor whose often stormy relations with South Yemen had improved under Mohammed, told Reuter that the station carrying rebel statements and using Radio Aden's frequencies appeared to be broadcasting from Lahej, an opposition stronghold 20 miles north of Aden. The sources said Mohammed was in his home region of Abyan, east of Aden.

Ethiopian Radio said last night that Mohammed had held a meeting of his Yemen Socialist Party and later declared a blanket pardon for "all those who were incited by a few adventurists and narrow tribalists and who recently participated in the chaos created in the revolution." It said he warned that "appropriate measures will be taken" against those who fail to lay down arms.

Egypt's official Middle East News Agency and diplomatic sources said Mohammed spoke by telephone yesterday with Syrian President Hafez Assad, Algerian President Chadli Bendjedid and Libyan leader Muammar Qaddafi, but they gave no details of the talks.