Last Sunday evening after Peru trounced Iran 4 to 1 in a World Cup soccer match, thousand of young people surged into the streets of Miraflores, one of Lima's best residential neighborhoods, to celebrate the victory.

As the crowd grew larger, drunker and more boisterous, the mood suddenly changed. The young people stopped cheering the national soccer team and started denouncing the national government. Windows were smashed, cars were damaged and troops were finally called in to disperse the young men and women, who had begun to chant "Down with the military" in place of "Viva Peru."

The incident in Miraflores, which occured just a week before the first national elections to be held here in 15 years, was one more recent indication of what most Peruvians think of the generals who have governed their country since 1968, when the armed forces overthrew the elected government of President Fernando Belaunde Terry.

The military men, influenced by leftist thinking then in vogue throughout Latin America and disappointed in the pace of reform under Belaunde, promised to make a revolution "neither capitalist nor communist" that would end centuries of economic and social injustice in this ancient land of Incan and Spanish culture on the west coast of South America.

Now, with the country having just averted international bankruptcy and the economy in shambles after a decade of "revolution" Peruvian style, the military government of President Francisco Morales Bermudez had decided to go ahead with Sunday's elections as a first step toward restoring a democratically elected, civilian government here in late 1979 or 1980.

The election will give about 5 million Peruvians who can read and write (more than 2 millions Indians may not vote because they do not read Spanish) the opportunity to select 100 members of a new constituent assembly that will prepare a new constitution to replace the current 1933 one.

Twelve political parties - ranging from the far left to the extreme right - have qualified to participate in the elections, Belaunde's Popular Action party withdrew several months ago saying that the present constitution does not need to be completely rewritten, that the new assembly will be under the thumb of the military and that, with 12 or 13 parties represented, the assembly will have great difficulty reaching a consensus.

The elections have already been postponed one by the government - after the independent Election Commission said it wasn't ready to hold the ballot because of administrative problems. The elections were almost postponed again three weeks ago after Peru was paralyzed by a two-day general strike called by the country's leftist labor unions to protest a series of harsh austerity measures by Morales Bermidez.

The measures, which raised the Prices of basic foodstuffs such as cooking oil by as much as 120 percent and the price of gasoline by more than 50 percent, were demanded by the International Monetary Fund and a consortium of international banks as the price Peru would have to pay to avoid default on hundres of millions of dollars worth of loan repayments due this year.

In all Economics and Finance Minister Javier Silva Ruete said Wednesday night, Peru's public and private, long and short-term debt stands at more than $8 billion - $4.8 billion of it owed by the government itself on a long-term basis.

To maintain order after the austerity measures were announced May 15, Morales Bemudez declared a state of emergency, which continued until late last week. For three weeks, political meetings were banned, the country's independent publications closed down, a curfew was in effect and 13 political leader 12 of them leftists and several of them candidates in Sunday's election - were exiled to Argentina.

The government has refused to allow those sent abroad to return for the elections, while at least five other prominent leftist candidates have gone underground rather than face arrest or deportation. Indeed, the government has harassed the leftists ever since the general strike, refusing to allow them to hold large political rallies, censuring their speeches on television and refusing to allow most of their magazines to resume publication.