Tanzanian President Julius Nyerere vowed yesterday to strike back at the invasion force of Ugandan President Idi Amin and to fight "until this snake is out of our house."

At the same time Nyerere confirmed the Ugandan report that Tanzanian troops had down three of Tanzania's own jet planes after mistaking them for Ugandan aircraft.

In his first public speech since Uganda invaded northwestern Tanzania Sunday, Nyerere rejected offers by Kenya and Sudan to mediate the dispute. Calling Amin a "barbarian," he said: "We have the means and ability to beat him. We are going to fight."

[In Washington, the State Department expressed concern about Uganda's seizure of Tanzanian territory. Spokesman Kenneth Brown said that the United States supports the principle of territorial integrityin Africa and that the Ugandan action "would appear to be a clear violation of that principle."]

Nyerere spoke to top government and party officials for 15 minutes in an address broadcast live over Radio Tanzania. He warned the country to be prepared for a long war, and said that the presence of Amin's troops 18 miles inside Tanzania "has helped us to end all arguments."

He declared: "He has clearly told the world who the aggressors are. All Tanzanians have one major task before them and that is to beat Amin."

Amin said earlier that his troops, backed by tanks and artillery, had seized 710 square miles of Tanzania in retaliation for a Tanzanian invasion of Uganda.

Nyerere explained the destruction of the three Tanzanian planes by saying the jets had strayed off course in an area that had been bombed by Ugandan planes just a few hours before.

Tanzania and Uganda both fly Soviet-built Migs, and experts here say it would be easy for inexperienced troops to confuse the two countries' aircraft. Intelligence sources said Tanzania appears to have grounded its planes while it devises a better detection system.

Nyerere also announced that Tanzania has downed three of Amin's Migs, but he gave no other details of the fighting or casualties. A high government officials said, however, that 2,000 to 3,000 Ugandan troops are inside the country.

Unlike Radio Uganda, which has carried a steady stream of war communiques, martial music and announcements from Amin, Tanzanian radio has said little about the battle. Nyereresaid that until now the government has not wanted to intensify the dispute by countering all of Amin's claims.

News-hungry Tanzanians have been tuning their radio to the BBC, and to Kenyan and Ugandan broadcasts to hear the latest reports.

Despite the silence on the airwaves, a massive mobilization is clearly underway. Several trucks loaded with armored personnel carriers wrapped in canvas rumbled through town yesterday on their way to the railway station, where a train had been assembled to move troops and heavy equipment to the front.

All offices were asked to prepare lists of employes who have undergone nationalservice, the military and political training required of all secondary school graduates.

Dar es Salaam residents, hearing rumors of an impending gasoline shortage, lined up at gas stations throughout the city.

In general, people here seem to relish the prospect of a good fight with the Ugandans. Despite the government newspaper's pronouncement that Tanzania does not want "even an inch" of Uganda, many Tanzanians are hoping their forces will drive all the way to Kampala.

"It would be good to finish Amin once and for all," one shopkeeper said. This big daddy is causing trouble for everyone."