Centrist leader Julio Maria Sanguinetti was inaugurated here today as president, returning this small South American country to full democracy after nearly 12 years of military rule.

Sanguinetti, 49, took the oath of office this afternoon in a ceremony at the Congress attended by eight heads of government and U.S. Secretary of State George P. Shultz. In an emotional address, Sanguinetti then promised to rebuild the political traditions that had made Uruguay a model of Latin American democracy for 50 years before military rule.

"Democracy is our political system. It is our reason for being. It is our philosophy of life. It is our reason to feel in our fight that we can overcome," Sanguinetti declared, waving his arms dramatically as he extemporized before the Congress. "We should build a society without fear, as it always was."

The inauguration made Uruguay the eighth country in Latin America to replace military rule with a civilian democratic government since 1979. Brazil, the largest country in the region, is scheduled to return to civilian rule in two weeks. In Latin South America, only Paraguay and Chile continue to be governed by their armies.

Thousands of persons gathered outside the hotel where foreign dignitaries are lodged here to cheer Nicaraguan President Daniel Ortega and other Latin American leaders as they came and went. Shultz was greeted with chants of "assassin" and "Yankees out" when he arrived last night. Tonight, Montevideo resounded with the clamor of national celebration as happy crowds packed downtown streets and danced and sang with popular musicians performing in plazas.

In his address to the Congress, Sanguinetti echoed the preoccupation of new civilian governments around the region with economic crisis and its dangers for democracy. "We all know that in America we are passing through the worst crisis in this century," he said.

"We will have hard years without any doubt," he added. "How many limits, how many traps there are for democracy. Naturally, it is not possible to achieve a miracle. The limits and needs are very great, and this will require an effort of the entire country."

Like its neighbors Brazil and Argentina, Uruguay overborrowed from foreign banks during military rule and suffered a severe recession beginning in 1981. Workers' wages in this nation of 2.8 million people have shrunk by 45 percent in three years, and inflation is running at more than 80 percent.

Sanguinetti, whose Colorado Party won a 38 percent plurality in last November's elections, is expected to begin his five-year term by negotiating a new economic plan with the International Monetary Fund, a necessary first step before talks with banks on rescheduling Uruguay's $5.8 billion foreign debt. However, Sanguinetti declared today that "we cannot pay the foreign debt on the basis of a recessive adjustment, or one that maintains the economy in its level of stagnation."

With minority representation in both houses of Congress, the Colorados have concentrated on building a political consensus behind economic policies before taking office. The country's four major political parties agreed last month on a general plan for economic policy that calls for reactivating industry, promoting exports and gradually raising the level of workers' salaries.

Political observers here say Sanguinetti's most difficult opposition may come from the Broad Front, a left-of-center coalition including the pro-Moscow Communist Party, which won 20 percent of the vote. While two supporters of the National Party, the Colorados' traditional rivals, accepted positions in the Cabinet, the party has taken a position to the left of the government.

Much of Sanguinetti's initial political agenda is devoted to reversing the vestiges of the military's harsh authoritarianism and recompensing its victims. The president has promised to legalize the Communist Party and lift bans that still bar about 3,000 citizens from political activity.

About 10,000 persons dismissed from jobs as teachers or civil servants for political reasons under military rule will be reinstated by the new government and paid for their lost time, at an estimated cost of at least $150 million. In addition, the Congress has already begun debate on an amnesty for about 150 remaining political prisoners.

As in Argentina, Uruguayan military officers may be subject to trial for criminal violations of human rights. Officials said, however, that the government will not press its own cases against commanders but will allow citizens to file suits.

Relations with the armed forces are expected to be one of the government's most sensitive tasks. Army commander Hugo Medina declared last week that the armed forces would seize power in a coup, as they did in 1973, if necesary.

Today, Sanguinetti won a standing ovation from the Congress for the simple declaration that "in a little while, I will assume command of the armed forces."