President Jose Napoleon Duarte's Christian Democratic Party won an overwhelming victory in yesterday's elections, ousting conservative rivals from control of the Legislative Assembly and of a majority of the nation's town halls, according to unofficial but reliable totals compiled today.

The assembly and the town halls had been the main political power base for the Salvadoran right, but the returns from 80 percent of polling places showed a stunning reversal. The centrist Christian Democrats and a small allied party increased their number of seats from 26 to 34 in the 60-seat Lesgislative Assembly, while the conservative parties went from 34 to 26, the results indicated.

In addition, the Christian Democrats apparently won about 70 percent of the nation's 262 mayoralties, up from about a third previously.

The tallies were compiled by the Christian Democrats on the basis of official results from individual polling places. The campaign manager of one of the major conservative parties conceded that it had received a "drastically" reduced vote.

The election was widely viewed as a turning point in Salvadoran politics and in the government's U.S.-backed war against left-wing guerrillas. During his first nine months in office, Duarte repeatedly was thwarted by the conservatives' majority in the assembly.

Although voter turnout was low compared to last year's presidential elections, the manner in which the election was carried out was seen as reflecting a consolidation of the democratic process here.

Observation of the voting indicated that all parties cooperated in monitoring polling sites across the country and that the armed forces remained neutral. This fourth election in three years was by far the most peaceful, with the Army out in force.

Heavy fighting was reported in only one place, the northern town of San Fernando, late yesterday. But government troops retreating from the area managed to hold on to ballot boxes, Salvadoran and U.S. officials said.

All told, there were 20 municipalities in guerrilla-dominated areas where people were obliged to vote in towns other than where they lived, less than half the number in that category a year ago, U.S. officials said.

One big question was what course the conservatives' extremist factions will now take: whether they will remain within the democratic process or resort again to the large-scale political violence of three or four years ago. Another question was whether Duarte's added political strength would enable him to achieve progress in the peace talks that he launched last October with the left-wing insurgents.

Duarte addressed both of these questions in an interview with a small group of U.S. reporters last night. He offered to grant government posts to conservative political parties if they endorse his goals, and other Christian Democratic leaders indicated that Duarte would move cautiously in such areas as strengthening his land reform, which the conservatives have opposed.

"I will offer my hand to help them. I will invite them to sit down, and talk to them," Duarte said of the conservatives. "There's now an understanding that we're not the enemies of private enterprise," he added.

The president said he thought that his opening of the dialogue with the guerrillas was the "decisive" factor in winning the election. "The people received the message. The people want peace," Duarte said.

The results indicated that the Christian Democrats' biggest gains were in provinces that are most contested by the government and the guerrillas. It was unclear, however, whether these gains resulted from the Army's improved performance or from voter approval of the start of the peace talks.

Duarte drew attention to the contrast between the country now and at the time of the 1982 legislative elections -- when the guerrillas were much stronger, and when right-wing vigilante groups and extremist elements in the armed forces were murdering hundreds of persons each month.

"You've been in these elections, and you've seen the difference. This is because the armed forces was really there, helping the democratic process. They deserve a recognition of that," Duarte told the reporters.

Dozens of voters interviewed yesterday in several towns and villages said they were voting because of what many called a "civic duty." They disputed the suggestion, often raised by the left, that they voted because they were intimidated by the armed forces.

"El Salvador has overcome that problem. Those fears have gone away. People vote because they want to," Jose Escobar, 32, said here.

For the first time, voting yesterday was not obligatory. Last year, the law provided for fines of up to $13, although there were no reports that such fines actually were levied.

U.S. Ambassador Thomas Pickering, in an interview this afternoon, said that the election "has the potential for enhancing President Duarte's role in dealing with the military, the private sector and the dialogue" with the guerrillas.

While the vote was primarily a referendum on Duarte, Pickering said, "in a way it's been a backhanded referendum on U.S. policy" over several years.

The first official results were not expected until Tuesday, a Central Elections Council official said. But the Christian Democrats compiled returns on the basis of telephone reports to their party headquarters from poll watchers who monitored the drawing up of the official tallies at polling sites. The party did the same last year, and its results proved to be accurate.

The party's returns also tallied almost exactly with results of an exit poll conducted by a U.S.-based, Spanish-language television network yesterday. Luis Lagos, campaign manager for the conservative National Conciliation Party, did not dispute the Christian Democrats' returns. The other major conservative party, the Nationalist Republican Alliance, or Arena, declined to comment.

The Christian Democrats' returns showed their party taking 54 percent of the popular vote nationwide, compared with 37 percent for the conservative coalition that includes the National Conciliation Party and Arena. Smaller parties picked up the remaining votes.

The conservatives' main losses were suffered by the National Conciliation Party, whose share of the vote dropped from 19 percent last year to an apparent 8 percent yesterday. Arena, led by ex-major Roberto D'Aubuisson, maintained its share of the vote at 29 percent. Under terms of the coalition, however, the two conservative parties will divide assembly seats almost equally.

No solid figures were available on turnout, but the Christian Democrats' tallies and comments by political leaders indicated that it was down by approximately 20 percent from last year's presidential balloting -- when 78 percent voted.

Duarte and other political leaders said there was less interest in legislative and municipal elections, that voting probably was lighter because yesterday was Palm Sunday, and that several changes in the electoral laws this year tended to discourage voting.

In particular, voters were required to cast their ballots in the town or province where they were registered. Last year, special polling sites were established nationwide for the several hundred thousand persons who have moved far from their home towns because of the civil war. These polling places were dropped this year because they were considered to have contributed to widespread organizational problems in the first round a year ago.

It was unclear whether the conservative parties' supporters were the new abstainees, or whether abstention was a factor for all the parties and there was a shift in sentiment from the conservatives to the Christian Democrats.

Among reasons cited by political observers for the conservatives' defeat were a well-organized grass-roots campaign by the Christian Democrats in the countryside, where they historically have been weak. In addition, the formation of the conservative coalition may have cost them some assembly seats to the Christian Democrats because of the method of assigning seats.