Tanzanian President Julius Nyerere has issued a sharp warning to the United States and Britain Not to lift economic sanctions against Rhodesia and recognize the new government of Prime Minister Abel Muzorewa.

Nyerere, who is regarded as the elder statesman among black African leaders, said in a weekend interview that such a move would be "a very serious matter" and tantamount to a declaration of war against the two guerrilla groups fighting for power and their host countries, Zambia and Mozambique.

In a dire foreboding of the longrange consequences, Nyerere said lifting the sanctions would prolong the war and "destroy completely any hope for any whites remaining there."

Several African governments have voiced concern over growing moves by the new British Conservative government and in the U.S. Congress to recognize the new government and lift sanctions. Nyerere's remarks represent the sharpest warning at such a level since the movement picked up steam after last month's Rhodesian elections.

The Tanzanian president did not spell out specific moves he is contemplating in the event the United States and Britain recognize the new Salisbury government. But because of his commitment to black majority rule in southern Africa and his chairmanship of the five African front-line states, Nyerere is likely to deeply involved in decisions on Rhodesia in coming months.

Nyerere described the Muzorewa government as only "cosmetics" similar to the U.S. attempt at Vietnamization in Indochina.

"I still hope the U.S. and Britain will want to go to the heart of the problem and not settle for cosmetics," he said. "It will not solve the problem. It will only polarize the situation."

While he said he understands that President Carter is under pressure from right-wingers "who have not read the fine print of the new Rhodesian constitution," he is certain Carter himself realizes that the constitution leaves "the balance of power still with the whites."

"I don't believe the U.S. or Britain will recognize the new government. I don't think they'll solve their internal political problems by going to war with Africa," he added.

On Uganda, Nyerere denied that Tanzania's ouster of Idi Amin contravened international law or the Organization of African Unity charter, which prohibits interference in the internal affairs of member states. Nyerere, arguing that he was forced to move troops into Uganda to safeguard his territorial integrity, criticized the OAU for its failure to condemn Uganda's invasion into Tanzania last October.

"The only precedent I was fighting against," he stated, "was whether one country can invade another and get away with it. I don't want to establish a new principle permitting the overthrow of repressive regimes."

Nyerere said Tanzania, one of the poorest countries in the world, has borne the cost of the war by itself - more than $1 million a day.

Already Tanzania's nonmilitary imports have been cut back drastically and diplomatic sources estimate that within the next few months there will be shortages of imported consumer goods and industrial raw materials.

Nyerere said that although certain Western and communist countries were approached to help finance the war, "Tanzania did not receive aid from any of these countries."

He stated, "I did not ask the Americans for aid and they did not offer. We would have accepted had they offered."

Britain and West Germany have given sizable sums to help with resettling 40,000 Tanzanian refugees displaced during the Ugandan invasion, he said, adding: "I am very pleased and grateful for this assistance, but it can only be used for rehabilitation, not for the war itself."

According to diplomatic sources, Tanzania, with hard currency, bought arms from China and the Soviet Union. In addition several African countries are said to have donated arms.

Nyerere seemed conciliatory toward Amin's main military backers, Libya and the Palestine Liberation Organization. Even after Libyan leader Muammar Qaddafi had committed several thousand troops to fight for Amin and sent jet planes to bomb Tanzania, Nyerere refused to break diplomatic relations with Libya.

In addition, despite mounting evidence that the PLO was supporting Amin with fighters, bodyguards, pilots and advisers for the notorious State Research Bureau, Nyerere responded, "I think I know enough that anything I find out now won't upset me."

He said, "I look at it from a wider angle than the fact that I do not like Amin and would have liked others not to like him." He condemned instead "the world community" for first establishing the state of Israel and then isolating the PLO "so they were forced to seek support from Amin."

"Amin treated the Palestinians as friends and human beings," and therefore it is understandable that they assisted him, he explained.

He said Tanzania will continue to support the PLO.

Nyerere refused to say precisely how many Tanzanian troops are in Uganda. He stated only that "right now we have a lot more people inside Uganda than the total standing army of Tanzania."

According to diplomatic sources, the Tanzanian Army stands at about 75,000, of whom about 50,000 are in Uganda. At the start of the war the Ugandan Army numbered about 20,000.

Once the war is over, Nyerere said, his standing army will be reduced to about 40,000, of whom a high proportion will be officers and technical people.

Nyerere said that although the new Ugandan government has asked for Tanzanian help in many fields, he has agreed to assist only in training the army.

"We're a poor country and we don't want to get too involved because we know they'll end up resenting us," he said.

"We know this from experience. We have really helped all our neighbors to liberate themselves but, with two exceptions-Mozambique and Zambia - we're not friendly with any of them. It's an irony that no matter how careful we are, at the end of the day they resent our help."