South African Prime Minister John Vorster announced in Cape Town yesterday that his government has accepted a Western-sponsored plan to bring independence to the disputed territory of Namibia by the end of the year.

Vorster's decision to accept the Western formula for ending 58 years of South African rule over the mineral-rich territory seemed likely to bring strong international pressure to bear on the guerrilla group that has been battling South Africa, the South West Africa People's Organization (SWAPO).

If SWAPO also can be persuaded to accept the Western plan - which calls for an end to the guerrilla war, introduction of a U.N. peace-keeping force and free elections for a constituent assembly - a transition to majority rule may well prove possible without the kind of civil war looming in Rhodesia.

In New York, where the U.N. General Assembly is holding a debate on the Namibian situation, SWAPO leader Sam Nujoma declined immediate comment on Vorster's statement.

"That's his problem," Nujoma said.

U.S. officials, however, expressed hope that SWAPO would decide to accept the plan.

In Washington, Assistant Secretary of State for African Affairs Richard M. Moose praised Vorster's statement in terms rarely heard these days by South Africa, hailing his decision as an "extraordinarily statesmanlike and constructive step."

The independence plan, drawn up during the past year by the United States, Britain, France, Canada and West Germany, envisages a phased withdrawal of the 20,000 South African troops currently based in Namibia by the end of the year.

In announcing South Africa's acceptance, however, Vorster indicated that the final breakthrough to agreement came in a western "clarification" that some South African troops could remain in Namibia if asked to do so by an interim administration.

This seemed likely to make the South African acceptance suspect to SWAPO, since it has long insisted that all South African troops must leave Namibia seven days after the election of a constituent assembly.

Another key compromise that made the plan more palatable to South Africa was the Western decision to leave the issue of the future of the strategic port enclave of Walvis Bay to be decided after independence.

South Africa has made it clear that it regards the enlcave - the territory's only deep sea port - to be South African territory.

Vorster, in announcing his decision yesterday, said, "if the international community truly wants peace in the territory, the way is now completely open to achieving it."

Some African countries are expected to criticize the Western plan, worked out during a year of consultations with South Africa and SWAPO. The South Union and China have already attacked the proposals in informal committee debates at the United Nations.

The five Western powers were hoping to get quick U.N. approval and implementation of their proposals, which will require a substantial U.N. peace-keeping force to oversee elections and prevent conflict until indepence, tentatively scheduled for Dec. 31.

Norster emphasized yesterday that the South African troops would not be reduced or withdrawn from their posts along Namibia's 1,000-mile frontier with Angola until there was a "complete cessation" of hostilities by SWAPO guerrillas based across the border.

He warned that if there was renewed violence, troops would be sent back to their positions. "It stands to reason there will have to be peace throughout the electoral process, and that if that peace is broken then the necessary steps can and will be taken," he added.

South African authorities in the territory already have taken extraordinary measures to curb the political and tribal violence that has plagued the sparsely populated country since the beginning of the year.

It was announced yesterday in Windhoek, capital of Namibia, that 10 people were recently detained under a new law that allows indefinite detention without trial.

A spokesman for SWAPO, Luci Hamutenya, said that all 10 of the arrested people were members of her organization. "It is self-evident that SWAPO is not allowed to proceed with an election campaign, if stroying SWAPO," siad SWAPO official Emmanual Muatatara.

South Africa is clearly hoping that the Democratic turnhalle Alliance, a moderate white-led coa-and there were suggestions that a resolution of dis scheduled a business meeting for this afternoon Illion of ethnically based parties, will win the election, preventing a take-over by the Marxist-leaning SWAPO, which enjoys U.N. recognition as the sole legitimate representative of the Namibian people.

Leaders of the Turnhalle Alliance have already said that they will ask South African troops to remain in the territory if they win the election. They also claim to have the support of about 50 per cent of the country's 100,000 whites, who are the second largest minority group in Namibia.

But hostility between SWAPO and Turnhalle supporters wii

[TEXT OMITTED FROM SOURCE]tnese and difficult, if not impossible. Since the beginning of the year, fighting between the two groups has caused about 30 deaths including that of it make any election campaign extremely

[TEXT OMMITTED FROM SOURCE]former Turnhalle President and Herero tribal chief Clemens Kapuuo.

South African authorities have blamed SWAPO for Kapuuo's death, although there is no proof linking the guerrillas with the shooting.

There has been a continuing dispute between South Africa and the Western powers over the exact who will be appointed to supervise the transition period.

Vorster hinted yesterday that he had received assurances that the rold of South Africa's administrator general in Namibia will remain unimpaired, "namely that he will head the administrative structure of the territory."