The United States yesterday recalled its ambassador to Bolivia and cut off all military aid as the leader of a day-old military coup had himself sworn in as president of the South American nation.

The instant show of what a State Department spokesman called "our extreme disapproval of what has taken place in that country" was meant to demonstrate the Carter administration commitment to democratic change in the hemisphere and break the longstanding U.S. image of support for military dictatorships.

In Bolivia, where administration pressure helped overturn one coup last November and narrowly averted another by the armed forces in May, the U.S. government is now almost totally estranged from the military with which it was once closely allied.

Bolivian military figures last month were calling for expulsion of U.S. Ambassador Marvin Weissman for interference in Bolivia's internal affairs.

At least five persons were killed, a dozen wounded and an undetermined number arrested Thursday, when the military took over to prevent congress from electing a leftist president.

The congress had been scheduled to choose a new executive in early August because none of the candidates in elections last month won the required 50 percent of the vote. Front-runner Hernan Siles Zuazo, a leftist former president, was expected to be tapped by the legislature.

Asked if the United States had known about Thursday's coup plans in advance, spokesman John Trattner said, "We had not been informed . . . And we have made our position clear to the military on many occasions."

Bolivia's ambassador to the United States, Roberto Arce, resigned in protest over the coup although he was unable to transmit his resignation to the self-declared new Government of National Reconstruction, composed of the heads of the three uniformed military services, because telephone and telex communications with the land-locked South American country had been closed down.

Meanwhile, according to news agency reports from La Paz, the capital, the military consolidated its grip on power and launched a series of operations against armed workers challenging its control. Troops and tanks were sent to the country's southern tin-mining region to end labor resistance to the coup, military reports said.

Some 5,000 unionized miners, mostly Indians, took up arms and barricaded mountain roads leading to the tin mines, according to broadcasts by radio stations controlled by the miners' union and monitored by the Associated Press. The mines, which provide the bulk of Bolivia's income, are two to three miles high in the Andes in an area of 100 to 200 miles south of La Paz.

"We are going to resist the coup until the ultimate consequences," one broadcast said. Labor and civic resistance to a coup last November, in which more than 200 were killed, helped bring about a military retreat after 16 days. This time, informed observers feared that prolonged civil war between civilians and the military might break out.

The streets of La Paz were reported calm yesterday, however, after a night of sporadic gunfire.Martial law was declared in effect nationwide, and the military decreed yesterday a public holiday to offset the effects of a nationwide strike called by labor groups.

At mid-afternoon, army commander Gen. Luis Garcia Meza, a member of the new three-man junta, signed a decree designating himself president, and was sworn in by Gen. Armando Reyes Villa, commander-in-chief of the armed forces. The other two junta members are air force commander Gen. Waldo Bernal and navy commander Rear Adm. Ramiro Terrazas.

The ceremony came just hours after former interim president Lidia Gueiler, her voice cracking with emotion, officially resigned in a speech broadcast over the armed forces radio.

Gueiler and her cabinet were seized Thursday during a paramilitary attack on the government palace. But late reports from La Paz had her safely in the residence of the Vatican's representative there.

As head of the Bolivian senate last fall, Gueiler had taken over the presidency following a series of power changes that included two coups, and promised to hold elections this summer. Throughout her administration, she was pressured by the military to postpone the vote and to give more power to the armed forces, which charged that a leftist conspiracy was trying to take over the country.

In his statement yesterday, State Department spokseman Trattner said that the United States would hold consultations on Bolivia "with other countries in the region and the Organization of American States." He said the United States had had "no communications" with the Bolivian armed forces, which had been scheduled to receive $6 million in U.S. military aid, since the coup.

Trattner said the United States was not breaking relations with Bolivia, but that Weissman was being recalled "for consultations" for an unspecified period of time.

Other State Department sources also said that a private American citizen, whom they declined to identify, had been shot during the takeover and was receiving treatment in a La Paz hospital, where he was being assisted by U.S. consular personnel.

The sources said that while there had been no attacks against the U.S. Embassy, the embassy commissary was sacked by the military Thursday night; and that a sizable quantity of food had been carried away in an army truck.