Three black youths armed with Soviet manufactured machine pistols and hand grenades opened fire on white workmen in a downtown garage this morning, killing two and critically injuring one, in a daring attack that stunned Johannesburg.

South African Minister of Justice and Police Jimmy I. Kruger charged tonight that urban terrorists were responsible for the attack. He added, however, that there is no reason to believe there is a "direct organizational connection" between the killings and the unrest in Johannesburg's troubled African township Soweto.

The incident comes at the beginning of a week-long commemoration of the first anniversary of racial unrest that exploded in Soweto last June 16. During a year of sporadic disorders throughout the country, more than 600 people have died.

Mounting tension was visible among students and police in the sprawling ghetto of more than a million residents this morning. More than 1,200 students boycotted classes to protest the detention of 25 student leaders by security police over the weekend, a highly provocative move that observers feel could turn the planned peaceful demonstrations, mainly church services, into violence.

Police said tonight there had been only one incident in Soweto today when students stoned a bus. No one was injured and police used tear gas to disperse the mob.

In response to the growing tension here, Kruger appealed to the public, saying: "There is no reason to panic. The most important thing is to remain calm . . . police have complete control over the situation."

Concern was heightened, however, when Police Commissioner Gert Prinsloo confirmed this afternoon shooting were "of the same type" Kruger displayed in Parliament in January when he revealed that a cache of Soviet arms had been uncovered in Soweto. At the time, he warned Parliament," "These are indications of what we have to contend with in South Africa."

The only other recent incident of urban terrorism occurred last December when a black man threw a homemade bomb at a store in the plush downtown Carlton shopping center. There was only minor damage and only the African was injured.

After his capture, the man said he had been motivated by frustration over the oppression of South Africa's 18 million blacks by the privileged 4 million whites. He was sentenced last month to 24 years imprisonment.

This morning's attack was far more sophisticated. According to witnesses, the youths, with machine pistols slung over their shoulders, got out of a car on Goch Street and started walking toward John Vorster Square, the site of central police headquarters, where detainees are held.

The youths allegedly stopped at the entrance to the auto maintenance shop of a department store, then walked into it and opened fire on four men drinking tea during a morning break.

A woman working nearby said she heard an explosion seconds later, believed to be a hand grenade. Mechanic Robert Kassner died instantly. A second workman, Ken Wolfendale, died later in the hospital from head and chest wounds.

A third mechanic tackled one of the youths, knocking him out with an iron pipe. Police captured a second, and a dragnet is out for the third gunman.

Kruger said an interview tonight marked the beginning of widescale urban terrorism, but he warned South Africans that they would have to face up to the realities of terrorist attacks in South Africa.

The attack could not have come at a more delicate moment. Johannesburg has been bracing itself for the past month for the Soweto anniversary and the possibility of renewed violence. Newspapers, politicians and police have pleaded for peaceful commemorations.

There is growing fear tonight that trouble will break out over the next few days because of the jumpiness on both sides - police reacting to the attack today, and students angered by the arrest of their leaders over the weekend.

Many whites working in Soweto today - expecially those driving vans, a frequent target - were conspicuously armed with shoutguns. Police were seen pitching tents at a Soweto training center today to house reinforcements. Forces have been on full alert since last week.

Orlando High School principal Willie. Kambule said this morning that students were equally tense. After an assembly called to discuss the student detentions, the entire student body walked out.

At Sekano Ntoane High School this morning, an estimated 800 students - carrying militant, antigovernment signs and singing liberation songs - walked out to protest the detentions.

Kambule likened the situation to the week preceding last year's riots, when students boycotted classes. The initial dispute was over the use of Afrikaans, the language of South Africa's 17th century Dutch settlers, in black classrooms. Over the past year, student grievances have grown to encompass general discrimination against Africans.

The African National Congress has apparently attempted to spark new demonstrations. Congress leaflets were found early this morning on the grounds of several high schools, calling for a general strike on June 16-18.

But one student at Orlando who had seen the leaflets commented: "We don't need to have someone outside tell us what we should do. We are the spokesmen now, and we know what must be done."