Zambian President Kenneth Kaunda announced a "state of war" with neighboring Rhodesia today. In another major development affecting southern Africa, Mozambique's President Samora Machel said today that he opposes any peace initiatives on Rhodesia or Namibia.

The announcements by the two key leaders were seen as serious blows, although not total setbacks, to the latest Western-backed plans to establish black-majority rule in the two white-ruled territories peacefully. Both Rhodesia and Namibia are under guerilla attack.

Botwana's President Seretse Khama accused Rhodesia today of sending troops and helicopters across the border to attack a camp of his defense forces.

A Rhodesian military official said 50 Rhodesian soldiers confronted a Botswanan police patrol on Botswana's side of the 491-mile border. He charged that the Botswanan police were "shielding guerrillas who killed three persons in Plumtree, a Rhodesian border town, last night. Rhodesia has acknowledged three raids into Botswana this year.

The developments came just four days before Vice President Walter Mondale and South African Prime Minister John Vorster are scheduled to meet in Vienna, for talks on the peace efforts.

U.S. Ambassador to the United Nations Andrew Young arrived in Maputo Mozambisque's capital, tonight to attend a U.N. conference on southern Africa.

President Kaunda of Zambia made his surprise announcement at a press conference in Lusaka, declaring, "I wish to tell all Zambians today that we are in a state of war with Rhodesia. We will fight and I have already directed all my boys to shoot any Rhodesian planes on sight using Zambian airspace."

The Zambian leader also said he has appealed to "friendly nations" for support and arms, and made official requests to the United States and Britain to help block the operations of oil companies supplying Rhodesia, indirectly helping the Rhodesian counter-insurgency campaign.

Zambia has long provided bases for guerrillas from the Zimbabwe African People's Union, one of two movements involved in the 4-year-old was against the Rhodesian government. But this is the first time Zambia has committed its own troops, which number about 10,300 in the army, air force and paramilitary units.

The commitment by Zambia, until recently one of the more moderate of the five "frontline" African states, will make its 449-mile border with Rhodesia even more difficult for Rhodesia's already-stretched troops to defend.

Kaunda's declaration appears to have been triggered in part by a warning from Rhodesia, transmitted in a letter by British Foregin Secretary David Owen, that Rhodesia might attack guerrilla camps in Zambia.

The Zambia president said Owen had informed him that Rhodesian Prime Minister Ian Smith claims that intelligence reports indicated ZAPU planned a major new offensive against Rhodesia. Smith warned Owen that his troops might have no alternative but to launch preemptive strikes against the ZAPU bases in Zambia.

Owen's letter said Smith, "asks me to use my good offices with you to prevent the escalation which he believes could jeopardize our efforts to promote a political settlement."

Rhodesia officials said today that "no threat should have been implied," and that the message was aimed only at "averting a situation that might jeopardize current negotiations."

Kaunda did leave the door open for use of the Zambia capital as a conference center for the Anglo-American negotiating team involved in the effort to settle Rhodesia's 11-year-old constitutional crisis. He added, however, that negotiations would have to be conducted "within the framework of a war situation."

In Maputo, Mozambique's leader used even stronger language in referring to peace efforts. At the oepening of the U.N. conference on southern Africa, Machel told almost 500 delegates: "We believe it is a mistake to speak of peaceful solutions when there is war."

Machel added that he opposes any guarantees of rights for minirity whites which he said would "preserve colonialism."

Machel also called for: A end to all foreign investment, arms supplies and support for the white-minority governments in southern Africa.

Measures to isolate South Africa and Rhodesia in the same way that Germany was ostracized by the international community during World War II.

New aid and support for the five frontline states - Mozambique, Botswana, Tanzania, Angola and Zambia - that have backed the guerrilla campaigns against Rhodesia and Namibia.

A halt to the flow of "mercenaries" from Wester countries into the Rhodesian army. He said the refusal of unnamed countries to penalize mercenaries amounts to being an "ally" of the illegal Smith regime.

Delegates from more than 80 countries are expected to pass tough resolutions covering several of these points during the six-day conference in the former Portuguese colony, which gained independence two years ago.

Although the conference was called to discuss means of obtaining universal support for majority rule in Namibia and Rhodesia, it is expected that many of the resolutions will hit South Africa, which administers Namibia under a League of Nations mandate issued after World War I and serves as Rhodesia's only link with the outside world.

In an interview on South African television tonight, Vorster made it clear the government would not "take orders" from other countries, and said he was not intimidated by the threats from the conference in neighboring Mozambique.

During the recent buildup to the Vienna meeting, Vorster has repeatedly said that he is open to discussion of the problems of southern Africa but would not succumb to external pressures. He has warned South Africans, that they may have to "go it alone" if Western countries demand too much in exchange for support.

On the meeting with Mondale, he said: "In some circles it is suggested that I am going to Vienna to take orders. I'm not going there to take orders . . . As far as I am concerned, I'm going to Vienna to put South Africa's case.

News services added the following:

Western delegates to the Maputo meeting expressed guarded, optimism after Machel's speech, despite its bellicose tone. "It wasn't as negative as might have been expected," said a highlevel delegate.

The most fiery speech of the day was by Rhodesian black-nationalist leader Robert Mugabe, who rejected any direct U.S. involvement in negotiations, citing "deceptive schemes" by the Americans in the past. "Only through the instrument of war is peace possible in Zimbabwe," he said, using the nationalist term for Rhodesia. "We will hunt Smith down."

In Washington, the State Department had no direct comment on Kaunda's announced state of war with Rhodesia, but a spokesman said "We are naturally concerned by any prospect of escalation.