Tanzanian troops captured Kampala today, to the apparent delight of rejoicing Ugandans, and within hours a provisional civilian government was announced to replace dictator Idi Amin's battered regime.

It was the first time in post-colonial Africa that troops of one black African state captured the capital of another, but Tanzania moved quickly to put the occupied portion of the country under control of a government headed by Ugandan exiles.

Amin, who took power eight years ago in a military coup, fled Kampala before it fell.

He broadcast a defiant message late today from an undisclosed location apparently in eastern Uganda, declaring that he still considered himself president and that "we are in full control all over Uganda." Observers here and elsewhere in the region did not take the broadcast seriously and dismissed it as yet another bravado performance by the former British Army sergeant.

In Dar es Salaam, Tanzania, Ugandan exile leader Yusufu Lule announced the formation of a new Ugandan government in which he will be president. He promised to hold free elections, the first in Uganda in 17 years.

Lule, 67, a former president of Makerere University, and members of the newly formed Cabinet are expected to fly here Thursday.

The capture of the capital came during the night, with unexpected suddenness and apparently relatively little bloodshed.

Entering parts of town just before sundown Tuesday and occupying others under cover of darkness, the Tanzanians had Kampala residents going to bed thinking Amin's troops were still in charge, only to awake and find the city in Tanzanian hands.

"We literally stole the capital," said one jubilant Tanzanian officer."

By evening today-24 hours after advance Tanzanian elements had entered the capital and then fanned out through the city Winston Churchill called the "Pearl of Africa"-frequent automatic arms fire and an occasional artillery round were heard, indicating isolated resistance from Amin forces inside the city.

So tied down by mopping up operations were the invaders that their several thousand troops were unable to stop an orgy of looting by Uganda civilians.

The final push into Kampala met so little resistance that Tanzanian officers said "It was like a Chinese war movie where no one gets killed."

Casualty estimates were still sketchy, but the lead Tanzanian unit which I accompanied, suffered only two men slightly wounded Tuesday and a third today. Other units entering Kampala from the south and west also suffered only light casualties.

Fewer than 100 ugandan troops were killed and perhaps several dozen Ugandan civilians also lost their lives. At least 10 Amin soldiers were beaten to death by Uganda civilians taking revenge on the dictator's men.

The only known non-African casualties were Gert Kwellas, a West German U.N. official and his wife. They died when their car was hit by a rocket near the golf course.

Some Ugandan troops were either captured or killed when they sought to flee in commandeered civilian cars.

Preceded by three Soviet-built T-54 tanks and led by Col. Benjamin Msuya, the 800-man lead element of the 19th Division marched in from the south coming from Entebbe and were mobbed by jubilant Ugandans.

As night fell our unit occupied the radio station in the downtown Nakasero area, and encountered only occasional sniper fire from a nearby building.

After nightfall, troops led by tanks moved onto Kololo Hill, a plush residential area favored by foreign ambassies.

Again the troops encountered only light resistance as they dug trenches for artillery positions along the streets.

Loud speaker trucks toured Kampala's streets today, blaring: "The fascist dictator is finished."

Throughout Wednesday, groups of Amin troops were routed out of buildings and houses where they were hiding or sniping at the Tanzanian soldiers.

But the Tanzanians were less successful at curbing the looting as the rampage engulfed shops once owned by Asians deported en masse by Amin in 1972 and taken over by his Moslem fellow tribesmen from northwest Uganda.

Thousands of Ugandans poured into the largely deserted city that once had 350,000 residents and with great gusto smashed shop and office windows and carted away every moveable object.

Tanzanian plans call for anti-Amin Ugandan forces to take over from them once the city is quiet. The Tanzanian Army is then to withdraw.

Some anti-Amin Uganda units were positioned in the city center and Col. Tito Okello, their overall military commander, was reported to have arrived here.

The 11-man executive committee of the Uganda National Liberation Front announced tonight in Dar es Salaam that with the formation of the provisional government, it would seek prompt international recognition.

A 5 p.m. announcement over Radio Uganda, by Lt. Dol. David Oyite Ojok, appealed to "all Ugandans to rise up and join hands eliminating the few remaining murderers and looters still at large." He also asked "all soldiers who have not yet surrendered to do so immediately. Their safety is assured."

That broadcast apparently prompted Amin's broadcast retort.

"I, Idi Amin Dada, would like to denounce the announcement made by ex-Lt. Col. David Oyite Ojok that my government has been overthrown. This is not true." Amin said.

Amin's broadcast apparently came from a mobile transmitter relayed to Radio Uganda's main foreign-broadcast transmitter at Soroti in northeast Uganda.

In his broadcast, Amin said:

"I am speaking as president of the republic and commander of the armed forces. I am still in control. No one should be confused by this rebellion."

Tanzanian military sources insisted, however, that Amin, wherever he was, had neither the military strength nor the political support to hold out for long.

Tanzania and Uganda have been on bad terms since January 1971 when Amin ousted civilian President Milton Obote. The present war began Oct. 30, 1978.

Then Amin sent his troops into Tanzania, apparently to cover up a serious mutiny in his own army's ranks near his southern border.

Tanzania President Julius Nyerere pledged to topple Amin whom he regarded as a blot on black Africa's good name for his alleged killing of as many as 300,000 Ugandans. CAPTION: Map, no caption, By Richard Furno-The Washington Post