El Salvador's top electoral body this evening rejected a petition by two conservative parties to annul Sunday's elections. It acted 3 1/2 hours after the armed forces' high command went on nationwide television to urge respect for "the sovereign will expressed at the polls."

The events left little doubt that the elections would be upheld, handing a major victory to President Jose Napoleon Duarte's moderate Christian Democratic Party.

"The validity of the entire election is accepted," Mario Samayoa, the electoral council's president, said.

The high command called a news conference to dispute allegations by El Salvador's two largest conservative parties that the armed forces had acted improperly during the elections. The military communique, bolstered by the appearance of Defense Minister Gen. Carlos Eugenio Vides Casanova and the nation's 15 other highest ranking officers, clearly threw the military's influence in favor of respecting the elections' results.

The armed forces' action appeared to highlight a historic break, evolving for several years, between the military establishment and the political right, diplomatic sources and other political observers said.

The armed forces acted after the right-wing Nationalist Republican Alliance and the conservative but less extremist National Conciliation Party formally had proposed yesterday to annul the elections because of alleged irregularities. The parties charged that government officials had pressured voters, that there were indications of ballot-box stuffing and that military personnel had intervened in several cases on the Christian Democrats' behalf.

Representatives named by each of the two conservative parties control the three-member Central Elections Council, where they outvote Samayoa who was named by the Christian Democrats. But all three members voted against considering the petition to annul the elections, which if endorsed would have led to another election within a month.

They also voted to delay the vote count until Monday so political disputes would not disrupt the nation's traditional Easter vacation.

Arturo Mendez, the council member named by the National Conciliation Party, insisted that the armed forces' position had not influenced the council's decision. He said he voted against his own party's petition because of legal irregularities in presenting the proposal, because there was not enough time to prepare a new election and because the conservative parties' allegations were "more or less abstract."

Mendez acknowledged that the armed forces' declarations contributed to making the situation "very delicate."

Defense Minister Vides, sitting with his two deputy defense ministers, the chief of staff, and commanders of the Air Force and Navy, read the communique, which said, "The armed forces, at all times, has maintained itself within institutional limits enforcing and guarding the constitution and other relevant laws."

Commanders of the nation's six infantry brigades, the artillery brigate and the three security forces sat behind the high command at a rare news conference in the Defense Ministry's auditorium.

Vides called for a serious analysis of the conservative parties' complaints and rejected the accusations against the armed forces as "of no importance." He noted that the armed forces had lost 71 killed since Feb. 25 while defending the electoral process against attacks by left-wing guerrillas.

Tallies compiled by the Christian Democrats on the basis of official poll results showed that they had ousted the conservatives from control of the Legislative Assembly. The conservatives also apparently lost their control of a majority of the nation's town halls. Similar tallies proved to be extremely accurate in both rounds of last year's presidential elections.

Earlier today the conservatives gave signs of backing off. Nationalist Republican Alliance leader Roberto D'Aubuisson, a former Army major, denied that his party had accused the armed forces of intervening.

But documents submitted to the elections council by the alliance and the National Conciliation Party to support their annulment proposal cited several instances in which soldiers or military policemen allegedly had confronted conservative polling officials or supporters, apparently to enforce certain electoral regulations.

The U.S. Embassy also appeared to signal that it expected the Christian Democratic victory to be accepted.

"Our elections observers were in many parts of the country. They didn't see anything which they would have considered to be of sufficient gravity to nullify the elections," the embassy's chief spokesman, Donald Hamilton, said. U.S. Rep. James R. Jones (D-Okla.) led the official U.S. observers' delegation, which toured polling places on election day.

Hamilton said embassy officials "have spoken to all parties involved. We have reaffirmed our commitment to democratic processes in El Salvador."

The armed forces' action represented a switch in its role regarding President Duarte. In 1972, the military backed the National Conciliation Party in depriving Duarte of the presidency after an election that he now is generally acknowledged to have won.

The armed forces have been considered conservative and skeptical of Duarte, even though they supported him as head of the governing junta from 1980 until 1982, and as elected president since last June. Many commanders have been close to D'Aubuisson's party in recent years and have been implicated in the brutal repression of the left in the late 1970s and early 1980s.

With strong U.S. encouragement, however, the armed forces have safeguarded four elections here in the last three years. A modest purge of extremist officers has contributed to a steady decline in right-wing political killings.