Noted writer and painter Breyten Breytenbarh was acquitted today of charges that he took part in terrorist activities and plotted to overthrow the government from his maximum security cell in Pretoria Central Prison. The surprise verdict came after a traumatic and "unusual" trial.

Justice Wessels G. Boshoff ruled that there was "reasonable certainty" that the widely publicized Okhela organization - allegedly a white underground movement dedicated to overthrowing the government, of which Breytenbach was said to be a founder - had never existed inside the South Africa. The government had based much of its case on Breytenbach's association with Okhela.

While Breytenbach was acquitted of 17 charges, he was found guilty of 15 counts of smuggling letters in and out of prison and fined about $57. The possible sentence on the other charges ranged from five years in prison to death.

Today's verdict was the latest in a series of blows to the government in cases against alleged subversives. Earlier this week, Steve Biko of the militant Black Peoples Convention was found not guilty of conspiracy charges. Last year, at the marathon trial of several members of the militant South African Students Organization, a group of black students wer acquitted of anti-government activities.

The government had pinpointed Breytenbach, 37, a s a leading member of the white underground. The poet is currently serving a nine-year prison sentence for trying to return secretly from exile in 1975 with plans to organize an armed struggle against the white-minority government.

The case was particularly important because Breytenbach is an Afrikaner, a member of the tikhtknit ethnic group - descendents from 17th century Dutch settlers - who dominate the government and make up about 60 per cent of South Africa's 42 million whites. The government toleratts opposition from the English-speaking white population, but is more concerned about such a degree of "treason" from within its own fold.

Breytenbach has presented a blatant challenge to the values and traditions of his people through his surrealistic canvases, his political dissidence and his anti-government poems and prose. One of his poems is entitled "Letter from Abroad to the Butcher Balthazar," referring to Prime Minister Balthazar Johannes Vorster.

The government was over-anxious in trying him again, according to several lawyers here, who watched but did not participate in the trial. The entire case was based on the restimony of a prison guard. Pieter "Lucky" Groenewald, who was originally persuaded by Breytenbach to join Okhela and help him. Groenewald later confessed to his superiors and turned police agent, but he continued his conversations with Breytenbach, which were taped by police, went on missions for the prisoner, and took out mail for him.

The prosecution said Breytenbach had told Groenewald that Okhela would kidnap public officials, sabotage public facilities and force chance through urban terrorism. Breytenbach allegedly promised that Groenewald would receive training in the Soviet Union.

In a sudden verdict immediately following the summations. Justice Boshoff ruled that the state had not proved that Breytenbach had been involved in terrorist activities nor that he had persuaded the guard to hep him escape from prison. The judge also ruled that Breytenbach's organization - unnamed by Groenewald - was only a "front" to get poems, sketches and letters out of prison.

The judge's statement - which was not expected until next month - gave a broad view of Breytenbach's troubled past, going back to his early frustration and bitterness when South Africa refused to issue a visa to his Vietnamese wife, Yolande, whom he met as a student in Paris.

Boshoff noted that the letdown led to Breytenbach's increased contact with South African exiles in Europe, including members of the banned black liberation movement, the African National Congress.

Okhela, designed to be a white branch of the African National Congress, was founded in 1974. A "prosposed manifesto" was drawn up, but activities apparently did not so much further.

It was at this point that Breytenbach returned secretly to South Africa, was arrested by security police, tried on charges under the Terrorist Act, and convicted. On the stand during the first trial, the poet pleaded guilty and stunned observers by berging forgiveness for the "ridiculous and stupid" things he had done and apologizing to the prime minister for his offensive poem.