The 18 men trudged up the stairs from the holding cells into the courtroom. Their hair had grown long and matted in prison. Several wore grey overcoats to keep warm.

They sat down on two long benches nine on each. Behind each man's head a stick poking up from the back of the bench held a white card on which was written a number from 1 to 18 - for the purpose of identification.

Ranging in age from 65 to 20 years, these 18 black South Africans are accused of secretly promoting the Pan African Congress, a black political movement banned by the white government in 1960.

The alleged offenses, which include contacting Congress representatives abroad, holding meetings to talk about the Congress and organizing teen-agers to leave South Africa for military training are said to have taken place over the past 15 years in locations as diverse as Libya, Capetown, Robben Island Prison and the black residential suburb, Soweto.

These charges, which carry the maximum penalty of death make the men accused "terrorists" under South African law. Their trial, for which the state has ready 165 witnesses to testify, could take up to a year.

Because of the large number of defendants and because "accused number one." Zephania Mothopeng, 65, is reputed to be one of the top Congress officials inside South Africa, the Bethal trial has attracted much attention.

But it is just one of the numerous "terrorism trials" unfolding daily in South African courtrooms - a proliferation of trials that dramatically indicates the extent of the violent struggle against the white minority government already begun by blacks as well as the determined effort of the government to nip it in the bud.

But these security trials are also an instrument for putting hundreds of political dissidents into jail for long term sentences.

"In jail I got so used to being called "that terrorist" by the guards that I came to regard it meaning anyone opposed to the racial laws of this country, anyone black opposed to apartheid," said black newspaper reporter Enoch Duma, who was just acquitted of terrorism charges.

These prosecutions are made possible by two laws, the 1962 sabotage act and the 1967 terrorism act, which citing state security, sweep aside an individual's civil liberties.

Because the terrorism act so broadly defines "terrorism" one prominent attorney said, fears that it "covers acts not germane to terrorism have been realized. In cases where there is no violent act, the terrorism act is used to punish dissident. It is a clear warning to the do-gooders."

Last month, two white academics, Timonthy Jenkins, 29, and Stephen Lee 26, were given 12 and 8 years in jail respectively for terrorist convictions. Their crime: distributing pamphlets issued in the name of the black African National Congress calling upon blacks to demonstrate.

A 17-year-old black youth was given five years for writing a letter to a friend urging him to go to Botswana for military training. He told the court he did it "because I want to free my black brothers."

In 1976, nine people were given a minimum of five years in prison for organizing public rallies in support of the Mozambique liberation movement.

According to the South African Institute of Race Relations, as of last week 306 persons were being held under security laws that permit indefinite detention.

The terrorism act also allows police to arrest people on a mere suspicion they have done something wrong and to hold them incommunicado for as long as they want. This power is used not only to cut off dissidents from their community, but also to weed out potential state witnesses against former colleagues.

In most cases, state witnesses can be detained in solitary confinement until they come to court. This is "for their own safety." Justice Minister Jimmy Kruger said recently. In the past year, three men who testified against former friends in security trials have been gunned down in their homes, and police are clearly worried about this trend of retaliation.

Despite the obvious duress of solitary confinement, the attorney general of the Transvaal, J. E. Nothling, said that the act provides that a state witness can be "kept in detention until he satisfies the police . . . until he answers questions truthfully. But whether he is under pressure beyong what is provided for in the law, I can-

Many terrorism act detainees say they are beaten and tortured to make statements to the police. More than 20 people died while in security police custody during 1976 and 1977. Police deny they use physical pressure to get their statements and they say all deaths were from natural causes, suicides or accidental - as they say was the case with black consciousness leader Steve Biko, who died last September.

There were a large number of security trials under the sabotage act in the early 1960s, including that of Nelson Mandela, president of the banned African National Congress who is now serving a life sentence. These abated until the early 1970's when they picked up and then dramatically increased after the outbreak of black unrest in June, 1976.

According to the head of security police, Brig. C. F. Zietsman, 2,500 "potential terrorists" have been brought to trial under security legislation since June, 1976. "You can see it is no longer child's play. It is an extened onslaught we are fighting," he told a local newspaper.

By far the greatest number of these trials have occurred in Port Elizabeth were black unrest has continued longer than in other parts of the country. It is not uncommon for courts there to give 12 and 18 year sentences for arson, lootings and stonings that happened during student riots.

Kruger and the police recently announced that a number of new terrorist trials would begin this year. Kruger also disclosed that 36 people, including one white, are serving life sentences under security laws and that 440 people, all but 40 black, were serving shorter sentences. Among these prisoners are six youths under age 16 serving 5-year terms for sabotage on Robben Island Prison off Capetown.

Although it is a capital offense, no one has been put to death as a result of a terrorist conviction. When a death has occurred as a result of a dissident's actions, the dissident is usually charged with murder and given the death sentence for that conviction.

This was the procedure with Solomon Mahlangu, 21, who was an accomplice in what the government here described as the beginning of urban terrorism in South Africa when three white men were killed by machinegun fire in downtown Johannesburg in June, 1976.

Critics of the ruling National Party, which is dominated by the 2.6 million Afrikaners of Dutch descent, say the government has created the terrorists it is now prosecuting.

Blacks are not allowed to hold rallies or protest marches, to organize political parties that criticize the government, voice their frustrations in newspapers and pamphlets nor have leaders who criticize the government. Because these avenues of normal political dissent are proscribed, many blacks turn to underground and violent actions, critics say.

"The National Party does not want to recognize that the reason people did these things was because they believed no lawful avenue was left to them to bring about necessary change," said one activist.

Blacks regard the terrorist trials as a vehicle for portraying to the government black anger," said reporter Duma, "to show them we're not dormant, that we have people who are fast losing faith and who have abandoned words."

Testimony at these trials discloses that despite 18 years of government repression, severe punishments and all-pervasive police informants, the African National Congress and Pan African Congress still maintain allegiances among a section of urban blacks, both young and old.

Some people regard the trials as harmful for the government. "Many accused have spoken in forthright terms as to why they did what they did," said one lawyer. "They don't seek to avoid responsibility for what they've done."

Often they draw a parallel between their acts and those of dissident Afrikaners like the members of Ossewa-Brandwag. To protest South Africa's entry in World War II on the side of Britain, the Ossewa-Brandwag blew up bridges and post offices. Prime Minister John Vorster spent two years in detention for his membership in this organization.

This historical irony was brought home clearly by one of the first men found guilty under the terrorism act - in fact, one of the men for whom the law was created: Toivo Ya Toiva, black nationalist leader at the time of his arrest in 1966.

In his defense, Toiva, now serving a life sentence on Robben Island, noted that the government "has chosen an ugly name to call us by. One's own are called patriots, or at least rebels. Your opponents are called terrorists."

Toiva then reminded the judge that in World War II he had joined the South African army "but some of your countrymen when called to battle to defend civilization resorted to sabotage against their own fartherland. I volunteered to face German bullets and - today (the saboteurs) are our masters and are considered the heroes, and I am called the coward."