Three black nationalist guerrillas were condemned to death today, and six others received prison sentences of between 10 and 20 years after being found guilty of attempted murder and high treason last week by a Pretoria supreme court.

As the judge entered the courtroom, the defendants broke out into a chorus of "We Shall Overcome" and sang a black nationalist song.

The comdemned trio stared blankly as the judge pronounced the death sentence, but people in the packed spectator's gallery gasped and gave clenched-fist black-power salutes.

Ncimbithi Johnson Lubisi, 29, Petrus Tsepo Mashigo, 20, and Naphtali Menana, 24, were given death sentences by Judge Jaap De Villiers for attempting to murder two black police officers Jan. 4 during an armed assault on the rural Soekmekaar police station in norhter Transvaal.

The high treason convictions stemmed from the admissions of all nine men to membership in the African National Congress, the country's oldest black nationalist organization. The nine, who ranged in age from 20 to 29, admitted receiving military training in Angola and Mozambique from the Soviet-backed organization after leaving South Africa in 1976 following a nationwide black revolt against the white minority government here.

They all returned about a year ago to carry out acts "of war and sabotage," the court said. In his testimony, Lubisi said he had returned "to cripple the government and to show them I was suffering."

The trial of the men, known as the "Silverton Nine," had received much press attention because they were also accused of murdering two white women last January in a hostage-taking incident in the Pretoria suburb of Silverton.

The women died when police rushed a bank where 25 whites were being held by three armed insurgents trained by the African National Congress. De Villiers found the nine men not guilty of the women's murders because they were not at the bank. The three men involved in the incident were killed during the police raid on the bank.

The Silverton bank siege and the June sabotage of South Africa's starategic fuel manufacturing plants, as well as other incidents including blasts on train lines and attacks on police stations, have focused public attention on the African National Congress. At the same time, the outlawed organization appears to have gained support among many black activists inside the country.

Nevertheless, testimony at the Silverton trial disclosed how ill-prepared and poorly trained are many of the insurgents sent back into the country. One of the men on trial had left his Soviet-made automatic rifle on his bed in the house where he ws lodging, and some defendants had given themselves up to police and then betrayed their colleagues.

One of the state's star witnesses was a former guerrilla assigned as a congress "commander" who had turned himself in to police upon his return to the country. He was indentified only as "Mr. X" at the trial to prevent any future retaliation against him.

Defense lawyer Jules Browde called the defendants "not well brought up, not well disciplined" as he argued for reduction of their sentences.

"It has been the history of this country for judges to sit in judgment on people who have committed offenses -- outrageous offenses to some portions of the community, and to other sections of the community taken to be part of the political scene and the times," Browde added in his final argument.

De Villiers gave permission for the three condemned men to appeal their convictions and sentences, but refused to allow the others to appeal. Earlier this year, an appeals court overturned a death sentence for another African National Congress guerrilla, James Mange, who was given life imprisonment instead.

In 1979, however, Solomon Mhlangu was hanged for his part in the 1977 deaths of three white men in Johannesburg although he had not actually shot anyone.

Those receiving jail sentences today were: Moses Molebatsi, Hlolili Benjamen Tau, Phumulani Grant Shezi, Jeremia Radebe, Boyce Johannes Mogale and Thomas Mngadi.