The South African government, grappling with spiraling violence, today imposed a nationwide state of emergency, and police immediately used its broad new powers to round up hundreds of antiapartheid activists in pre-dawn raids.

The new measures ban all unauthorized political gatherings, give police sweeping powers to make arrests and warrantless searches and detain persons indefinitely without charge, and put stringent new restrictions on local and foreign press coverage.

President Pieter W. Botha acknowledged in Parliament that the clampdown would fuel the campaign for international economic sanctions. But he said the emergency powers were necessary to combat the "climate of increasing violence" in South Africa and to prevent "radical and revolutionary elements" from staging "acts of sabotage and terror" next Monday, the 10th anniversary of the Soweto uprising in which hundreds of blacks died.

"The world must take note and never forget that we are not a nation of weaklings," said a defiant Botha in a later television address. "We do not desire and we do not seek it, but if we are forced to go it alone, then so be it."

The Reagan administration condemned Pretoria's action as a "serious mistake" that showed a misunderstanding of "the fundamental causes of unrest and violence there."

South Africa's currency, the rand, plunged to near its record low following announcement of the new security status.

Government opponents condemned the measures, which are in effect for an indefinite period, saying they would lead to a more violent confrontation between security forces and demonstrators next Monday. Businessmen here expressed strong reservations about the government's decision.

"It will only make things worse," said the Rev. C. F. Beyers Naude, secretary general of the South African Council of Churches, whose offices in downtown Johannesburg were among those raided by police today. "The mood of the people is one of anger and one of determined resistance. Their patience has run out."

Local human rights groups and news organizations compiled lists of between 200 and 300 names of detainees. Naude said he believed the figure could run as high as 1,200. A government statement confirmed only that "a number of people" had been arrested, but radio reports put the total at 1,000.

The restrictions come only three months after Botha lifted the emergency imposed last year on three of the country's major urban areas that led to 7,992 arrests over an eight-month period. The new rules are considerably more sweeping because they apply to the entire country and because they give the government even broader powers than it wielded last year.

Officials had hoped to avoid declaring an emergency by passing sweeping new security legislation before next week. But the bills are stalled in the mixed-race and Indian houses of Parliament.

Among the new restrictions is a nationwide ban on all television, radio and photographic news coverage, either domestic or foreign, of the civil unrest that has claimed more than 1,600 lives in this white-ruled country over the past two years. Similar coverage of police conduct during disturbances is also prohibited, as is the publication of the names of detainees unless such information is authorized in writing by police.

These restrictions are identical to those in effect until March in designated "emergency areas." But a new regulation bans the publication of any information or statements furthering "subversion," defined as including statements that advocate disinvestment or economic sanctions, oppose military conscription, endanger law and order or encourage protests or economic boycotts.

Deputy Information Minister Louis Nel said tonight that these restrictions would apply to foreign as well as local journalists. Violation of these or other emergency restrictions is punishable by up to 10 years in jail and an $8,000 fine.

The regulations allow police, prison officials and soldiers of any rank to arrest anyone they deem a threat to public safety and to conduct searches without first obtaining warrants. Detainees can be held for up to two weeks without charge and their detentions can be secretly extended indefinitely by a written order from the law and order minister.

Those arrested can be held without access to lawyers or family members and officials are not required to reveal any information about arrests or detainees.

Many activists who had gone underground in recent days in anticipation of the crackdown eluded police. But among those arrested were several senior leaders of the United Democratic Front, the country's largest antiapartheid coalition group, and several clerics, including Father Smangaliso Mkhatshwa, secretary general of the South African Catholic Bishops' Conference and a founding patron of the front.

Also arrested were several top trade union officials, leaders of the country's anticonscription campaign and seven high-ranking officials of the Azanian Peoples Organization, a radical black consciousness group.

The police raids hit black townships outside Johannesburg, Pretoria, Pietermaritzburg, Port Elizabeth, Cape Town and Durban. Several buildings housing religious groups, political organizations and labor unions were sealed off in the early morning hours by police wielding shotguns and submachine guns. Security police searched the premises and confiscated files.

At the Johannesburg headquarters of the Detainees' Parents Support Committee, a rights group, police seized affidavits alleging torture of political prisoners rounded up during last year's emergency, according to committee spokesman Audrey Coleman.

The new emergency measures are the culmination of several weeks of a harder line by the Botha government that has included commando raids on alleged guerrilla bases in three neighboring black-ruled states and a reiteration of the government's refusal to enter negotiations with the African National Congress, the outlawed black resistance movement.

This harder line led to the recent collapse of Commonwealth efforts to seek a diplomatic breakthrough to avert further bloodshed and save South Africa from economic sanctions. Today's emergency measures are certain to increase pressure on sympathetic western governments, including the United States and Britain, to apply further sanctions against Pretoria.

"The government feels it will be able to ride out the storm," said the Council of Churches' Naude, "because they are confident when it comes to the crunch that the United States, Britain and Germany will back them."

Some businessmen who cautiously welcomed last year's crackdown were outspoken in condemning the new measures. J.R. Wilson, the president of the Federated Chamber of Industries, issued a statement disassociating the chamber "from the strategy of political repression and economic isolationism to which the South African government is apparently committed."

Botha in his television address tonight seemed resigned to international condemnation and eventual economic sanctions.

"I do not underestimate the sacrifices and problems that sanctions will bring," he said. "I do not think that it will be in our interest, or in that of our neighboring states, or that of our trading partners. But South Africa will not crawl before anyone to prevent it . . . "

He said he would continue to seek to meet the "reasonable aspirations" of all South Africans. But he said he would not bargain with groups like the African National Congress, which he said was under control of the South African Communist Party. It is the principal guerrilla group fighting white rule.

From its headquarters in Lusaka, Zambia, the ANC said, "Our people will respond to these provocative acts of repression by observing this 10th anniversary of the Soweto uprising in their millions, ensuring the June 16 strike is the biggest in the history of the country," the Los Angeles Times reported.

Canada announced it would ban the purchase of South African goods by its government, prohibit South African tourism promotion and order four economic attaches from Pretoria to leave the country.