JOHANNESBURG, JULY 14 -- More than 50,000 black metalworkers defied a government order prohibiting a strike and walked off their jobs in about 500 plants across the country today as labor tension tinged with political dissent mounted in South Africa.

Hours later, however, the newly formed National Union of Metal Workers of South Africa asked its members to return to work on Wednesday until the legality of the walkout could be established in court.

The strike came as 200,000 black miners were poised to shut down 27 gold mines and 18 coal mines following a breakdown in wage negotiations with the employers' Chamber of Mines.

The National Union of Mineworkers set a strike date but kept it secret because of the possibility of a compromise offer from management, union officials said.

A prolonged miners' strike would be devastating to South Africa's already strained economy, as mining accounts for more than half of export earnings.

The two labor actions came on the eve of the first national convention of South Africa's largest labor federation, the Congress of South African Trade Unions (COSATU) -- which is expected to be the biggest gathering of workers ever held in this country.

COSATU is expected to adopt the Freedom Charter of the outlawed African National Congress, the 1955 manifesto for ending racial separation and white-minority rule in South Africa.

With much of the leadership of extraparliamentary opposition either detained or driven underground by the 13-month-old national state of emergency, black trade unions have moved to the forefront of the antiapartheid movement.

Government officials have threatened to crack down on the politicization of the unions and already have taken action against COSATU and some other labor groups.

The strike by most of the 80,000 metalworkers' union members began after the government published -- and then refused to reconsider -- an order summarily extending an old wage contract another year and thereby automatically making a walkout illegal.

As union attorneys filed an application in the Supreme Court for an emergency restraining order against the government decree, workers began their job action on the basis of a strike vote held last week, metalworkers union spokesman Peter Dantjies said.

A decision on the union's challenge is expected later in the week.

"We're living in a mad situation here in South Africa. Negotiations mean nothing," said Dantjies.

Officials said the union would conduct a separate strike vote for the 16,000 employes of the huge state-owned Iron and Steel Corp.

The union, which was formed this year by the merger of seven unions and is now the second largest in South Africa, said in a statement, "There is overwhelming support among our members for strike action" over an agreement reached June 9 between the managements' Steel and Engineering Federation and 14 other metalworkers' unions.

The agreement provides for the equivalent of a 20-cent-to-36-cent hourly wage increases.

The new union, which claims to represent the majority of metalworkers, is demanding a 50-cent increase and a new basic minimum wage of $2 an hour. It said 95 percent of its members approved a strike in balloting last week.

The miners' union has rejected a Chamber of Mines offer of wage increases between 16 and 23 percent, demanding instead a 30 percent across-the-board hike.

There are also disputes over vacations and benefits for danger and death.

Marcel Golding, assistant general secretary of the miners' union, said more than 95 percent of members voting favored a strike, adding that there is "immense strike fever on the ground." The union claims 300,000 members out of a total black mine work force of over 500,000.

In previous years, labor unrest in the mining industry has been accompanied by widespread violence. Black South African trade unions were legalized in 1979.

In recent months, as the United Democratic Front coalition of antiapartheid groups has been forced underground by government crackdowns, trade unions have flexed their muscles in the political arena.

COSATU was launched 19 months ago and now claims 800,000 members. It has become one of the most important black organizations on political issues, even though every antiapartheid campaign and rally it has tried to launch since April has been banned or disrupted by police.

Four of the federation's largest affiliates -- the miners' and metalworkers' unions, the Food and Allied Workers' Union and the Commercial Catering and Allied Workers' Union -- have adopted the 1955 ANC Freedom Charter.

Delegates to COSATU's national convention are expected to debate a resolution calling for a workers' political program that is more explicitly socialist than the ANC charter.

The federation's spokesman, Frank Meintjies, said that the government has refused to issue visas to convention delegates from the United States, Canada, Sweden, Denmark, Finland, the Netherlands and Norway. He said the U.S. unionists who were denied entry included Don Strill of the United Automobile Workers, Ken Zinn of the United Mineworkers Union and William Lucy of the American Federation of State, County and Municipal Employees.