A government headed by hard-line Marxist Haidar Abu Bakr Attas appeared firmly in control of this Arabian Peninsula country today after the defeat of former president Ali Nasser Mohammed, who reportedly tried to eliminate his political rivals last month in a preemptive wave of assassinations at a specially summoned meeting of the Politburo.

Troops were enforcing order here and in the provinces today, and essential services such as water and electricity have been restored, as a semblance of normalcy returned nearly three weeks after the outbreak of bloody street battles that brought South Yemen close to full civil war.

In an acknowledged effort to portray Mohammed as the architect of a brutal wave of political killings, government officials today took visiting western journalists on a tightly controlled tour of sites where Mohammed's bodyguards allegedly machine-gunned his rivals after Mohammed had called them to a Politburo meeting and then left town to await the outcome.

The most gruesome sight was the bullet-riddled Politburo conference room, still blood-soaked and reeking of death -- and left untouched as a grisly monument to the slain leaders. Mohammed, who reportedly was at his home in Abyan Province, 50 miles east of Aden, at the time of the slayings, was said to have since fled South Yemen.

Attas, who was prime minister in Mohammed's faction-ridden government, was abroad when the fighting broke out and went promptly to Moscow. He returned here on Jan. 25 and has taken over as provisional president of the country, which, under a succession of leaders, has remained a staunch Soviet ally for the past 17 years.

Aden's seaport, from which thousands of foreigners were evacuated under fire last month, is open again, and the international airport reopened briefly late last night as the only surviving jetliner of South Yemen's national airline made a blacked-out landing as a precaution against any possible missile attack.

The plane carried six western journalists, to whom the new government appeared eager to demonstrate that the conflict has ended.

Although there are signs that widespread fighting occurred throughout Aden, the damage does not nearly match the descriptions given by western diplomats after they fled the capital two weeks ago. Casualty figures were said by Yemeni officials to be only a fraction of the 10,000 reported dead during the first days of the street battles.

One official said the figure was more likely to be in the hundreds, and the spotty nature of the damage to buildings appeared to support his contention.

However, the secretariat building of the ruling Yemen Socialist Party's Central Committee bore witness to the apparent ruthlessness of what officials said was Mohammed's attempt to eliminate party opponents.

Killed in that attack, officials said, were Vice President Ali Ahmed Nasser Antar, an outspoken opponent of Mohammed; Defense Minister Saleh Muslih Qassim and Ali Shaiyia Hadi, head of the party's discipline committee.

Missing and presumed dead is Abdul Fattah Ismail, a Politburo member and former president who was in exile in Moscow from 1980 to February 1985 and whose return apparently fueled personal and tribal rivalries in the leadership of South Yemen, the only avowedly Marxist state in the Arab world.

The Politburo slayings were accompanied by a wave of assassinations here in which, officials said, at least 50 high-ranking party figures died. Political observers said the carnage was not merely an ideological struggle between Marxist factions in this strategically situated, pro-Soviet state, but a showdown stemming from bitter personal enmities and rivalries between tribes of the northwest, which was Ismail's home, and the eastern region, which is Mohammed's.

According to government officials, Mohammed called for a meeting of the 11-member Politburo at 10 a.m. on Jan. 13, and then two hours before its scheduled start he left for his home province, leaving his Mercedes and a contingent of his bodyguards at the secretariat.

Four of Mohammed's allies on the Politburo also failed to show up at the meeting. But six other unsuspecting members, all critics of the president, gathered at the long, U-shaped conference table, drinking tea and chatting as they waited for their president, according to government officials and witnesses.

"They thought everything was normal," Mohammed Hubaishi, the director of external information, said. "When they arrived, they asked Ali Nasser's bodyguard if he was inside, and then went in."

While the Politburo members waited, one of the president's bodyguards, named Hassan, entered and put Mohammed's briefcase by his seat at the head of the conference table, Hubaishi said.

A few minutes later, he said, Hassan returned, aimed a submachine gun at Antar and emptied the magazine of 40 rounds. Simultaneously, gunfights broke out in a corridor between Mohammed's bodyguards and secretariat guards as Qassim drew a revolver and killed Hassan before dying himself, along with Hadi. Also killed by Mohammed's forces, Hubaishi said, were Ali Assad Mothanna, a Central Commmittee secretary, and Politburo aide Ali Saleh Nasher.

The three other Politburo members at the table fled to an adjoining room, Hubaishi said. They lowered a curtain to supporters outside and hauled up two submachine guns, which they used to fire back at the attackers.

The three -- Ismail; Salim Saleh Mohammed, a Central Committee secretary; and Ali Salem Beid, minister for local administration -- then retreated to an office and spent the next nine hours using telephones to appeal desperately to the armed forces for help.

About 7 p.m., officials said, Ismail left the building. He was seen being driven away in an armored personnel carrier, but has not been seen since. His house, on a hilltop overlooking Aden, was a burned-out shell today, bearing signs of tank gunfire.

Officials took reporters to another hilltop site with large bloodstains and bullet holes. They said 16 officials of the ruling party had been killed there by Mohammed's supporters on Jan. 16.

The turning point in the fighting reportedly came on Jan. 15 and 16, when the middle ranks of the Army turned against Navy and Air Force troops loyal to Mohammed after disclosure of mass murders by the president's supporters.

Armed struggle was a common feature of the 139 years of colonial domination by Britain, and since 1969, when South Yemen's first president was ousted in a bloodless coup, intrigue and political rivalries have characterized politics.

While tribalism and personal rivalries play a major role in the hostilities, the political struggles in the Yemen Socialist Party also have been marked by differences over whether the economy should be guided centrally or locally and whether socialism should be doctrinaire or flexible and pragmatic.