Two Army colonels, speaking in the name of El Salvador's armed forces, said yesterday they have overthrown the government of Gen. Carlos Humberto Romero because of "corruption" and promised major reforms.

the Carter administration, which had strongely feared that increasing political violence in the smallest Central American republic could lead to a lefist takeover before the end of the year, pronounced itself "encouraged" by the new government and sharply denied any involvement in Monday's coup.

A number of leftist groups denounced the takeover as an "armed forces maneuver" and called for "armed insurrection in the streets." At least six persons were killed and 40 wounded yesterday during battles between the military and leftists near the capital, San Salvador. Tanks were deployed to help keep order, according to United Press International.

The new government declared a 30-day state of siege, limiting constitutional rights and press freedom, and set a 10 p.m.-to-5 a.m. curfew.

In a decree published in local newspapers, Col. Jaime Abdul Gutierrez, 41, and Col. Adolfo Arnoldo Majano, 43, said that official "violence and corruption" would cease, that they would fight against extremists of the left and right and would dissolve ORDEN, an Army-directed civilian spy network held respnsible for human rights violations.

The decree promised free elections and union organization "for all sectors," an amnesty for political prisoners and exiles and economic redistribution, including an agrarian reform program.

The new military leaders indicated at least one and perhaps as many as three civilians would be named to serve with them in what they called a "Revolutionary Government Junta."

But as Antonio Morales Erlich, a leader of the opposition Christian Democratic Party, said in a telephone interview, "the new junta hasn't actually done anything it has promised yet. As far as I know, not a single prisoner has been released.

"Their program takes a number of elements -- like an end to repression and free elections -- from the Common Platform" issued several weeks ago by the Christian Democrats, other parties and union groups, he said. The platform listed demands that its signatories said would have to be met before they participated in congressional elections which the Romero government had scheduled for next March.

Morales Erlich and others described the country as relatively calm, but tensely expectant to see what the new government is going to do. San Salvador Archbishop Oscar A. Romero, a human rights militant and strong critic of the former government, issued a cautiously optimistic statement over the national radio and expressed hope that the new government would be "at the service of the people."

There appeared little or no military opposition to the coup, which drove Romero out of office and out of the country Monday and was apparently organized by "moderate" sectors in the armed forces.

One prominent businessman said he hoped the new government, and the democratic changes it promised, would serve to "isolate" the increasingly powerful left and lessen its appeal to student, peasant and union groups.

In Washington, State Department spokesman Hodding Carter said the United States was "encouraged" by developments in El Salvador, where the Romero government had grown steadily weaker as extremist violence increased dramatically in recent months.

While Carter denied that "the United States was involved or encouraged in any way" the coup, a State Department source said the coup "certainly did not take us by surprise."

The Carter administration has been closely monitoring the situation in El Salvador, where it feared an imminent leftist attempt at a takeover, ever since Sandinista guerrillas succeeded in driving Anastasio Somoza out of nearby Nicaragua in July.

During three high-level missions to El Salvador since then, department officials first tried to persuade Romero either to resign or to advance presidential elections scheduled for 1982. The officials held discussions with private-sector leaders as well as opposition political parties in an attempt to develop an anticipatory policy to develop an anticipatory policy before El Salvador exploded.

According to Salvadoran sources contacted by telephone yesterday and in interviews over the past several months, the idea of a coup by moderate military elements -- replacing vilian junta preparatory to calling elections -- had been one of several subjects discussed in those meetings. It was also publicly discussed among prominent Salvadoran civilians.

In U.S. congressional testimony last month, Assistant Secretary of state Viron P. Vaky said the Carter Administration saw "diminishing" prospects for a peaceful solution to El Salvador's problems.

Under heavy U.S. pressure, Romero, who was one of a line of Army generals who have held the presidency for nearly five decades, announced a numbers of reforms, All, however, were rejected by the opposition leaders as inadequate to alter what they often described as the prevailing "climate of repression."

Despite Romero's invitation for international observers to attend the March election, and a promise that the military-backed ruling party's next presidential candidate would be a civilian, past electoral fraud and continued repression of opposition potitical activity convinced many that a democratic change was not possible with Romero.

El Salvador's myriad lefttist groups, ranging from clandestine guerrillas to mass-action populist organizations, concluded that the government was becoming increasly weaker and stepped up both violent attacks and nonviolent protests against the Romero administration.

At the same time, Romero was pressured by hard-liners within the military and business sectors who believed the leftist threat had to be eliminated before any reforms were instituted.

There were persistent rumors in San Salvador that a coup might come from the right wing of the military. Right-wing extremist violence, which many charged was sanctioned, if not organized by the government, also increased dramatically.

Last week, unknown assailants attacked the U.S. Peace Corps office in San Salvador and the State Department last weekend drew up contingency plans for the emergency evacuation of U.S. personnel.

Despite the ostensible suddenness with which the virtually bloodless coup occurred, it appeared extremely well-organized.

There were reports that some plotters attempted a coup last Saturday and that several of them were subsequently arrested. These reports were denied by the Romero government.

On Sunday, the sources said, the plotters consolidated their plans and coordinated with accomplices in military garrisons throughout the country. On Monday morning, they informed Romero that the majority of the military was with them, and gave him until 3 p.m. to leave the country.

After checking with garrison commanders and finding that the plotters appeared to have control, Romero left the country Monday afternoon. Accompanying him on a flight to Guatemala were his vice president, foreign minister and the minister and deputy minister of defense.